Files
rose-ash/shared/sx/tests/test_parse_all.py
giles e8bc228c7f
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 11m37s
Rebrand sexp → sx across web platform (173 files)
Rename all sexp directories, files, identifiers, and references to sx.
artdag/ excluded (separate media processing DSL).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:06:57 +00:00

36 lines
1012 B
Python

"""Verify every .sx and .sx file in the repo parses without errors."""
import os
import pytest
from shared.sx.parser import parse_all
def _collect_sx_files():
"""Find all .sx and .sx files under the repo root."""
repo = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)
))))
files = []
for dirpath, _dirs, filenames in os.walk(repo):
if "node_modules" in dirpath or ".git" in dirpath or "artdag" in dirpath:
continue
for fn in filenames:
if fn.endswith((".sx", ".sx")):
files.append(os.path.join(dirpath, fn))
return sorted(files)
_SX_FILES = _collect_sx_files()
@pytest.mark.parametrize("path", _SX_FILES, ids=[
os.path.relpath(p) for p in _SX_FILES
])
def test_parse(path):
"""Each sx file should parse without errors."""
with open(path) as f:
source = f.read()
exprs = parse_all(source)
assert len(exprs) > 0, f"{path} produced no expressions"