from pathlib import Path
import json,sys
sys.path.insert(0,str(Path(__file__).parent))
from evaluator import check_case,invariants
P=Path(__file__).parent/'fixtures/cases.json'
checks=0
for c in json.loads(P.read_text(encoding='utf-8'))['cases']:
    got,ok=check_case(c); assert ok,(c['id'],got,c['expected']); checks+=1
    inv=invariants(c); assert all(inv),(c['id'],inv); checks+=len(inv)
print(f'LAB PASS: {checks}/{checks} deterministic checks')
