# 离线只读验证：不访问网络、不操作设备，只读取同目录合成输入。
import json, math, struct, statistics
from pathlib import Path
def check(d):
 out=[]
 for x in d:
  if 'enabled' not in x: out.append('缺字段')
  elif x['enabled'] is None: out.append('不允许null')
  elif type(x['enabled']) is not bool: out.append('布尔类型错误')
  elif x.get('mode') not in ('auto','manual'): out.append('未知枚举')
  else: out.append('有效开启' if x['enabled'] else '有效关闭')
 return out

if __name__=='__main__':
 fixture=json.loads(Path(__file__).with_name('fixture.json').read_text(encoding='utf-8'))
 actual=check(fixture['input'])
 assert actual==fixture['expected'], {'实际':actual,'预期':fixture['expected']}
 print(json.dumps({'状态':'通过','实际':actual,'边界':'仅离线合成样例，现场未测'},ensure_ascii=False))
