from pathlib import Path
import subprocess
import sys

ROOT = Path(__file__).resolve().parents[1]


def test_frozen_core_matches_canonical_html():
    result = subprocess.run([sys.executable, str(ROOT / "VERIFY_ENGINE.py")], cwd=ROOT, capture_output=True, text=True)
    assert result.returncode == 0, result.stdout + result.stderr
    assert "ENGINE_CORE_EQUIVALENCE_PASS" in result.stdout
