"""EST 테스트 앱: 처리기가 있는 화면 동작은 모두 단추·메뉴로 부를 수 있어야 함.""" import re from pathlib import Path ROOT = Path(__file__).resolve().parents[2] / "tools" / "est-test" def test_every_handled_action_has_a_trigger(): sources = { p.name: p.read_text(encoding="utf-8") for p in [*ROOT.glob("native-*.js"), *ROOT.glob("native-*.cjs")] } sources["index.html"] = (ROOT / "index.html").read_text(encoding="utf-8") handled = set() for text in sources.values(): handled.update(re.findall(r'name === "([a-z0-9-]+)"', text)) assert handled unbound = [] for name in sorted(handled): uses = sum( len(re.findall(rf'"{re.escape(name)}"', text)) - len(re.findall(rf'name === "{re.escape(name)}"', text)) for text in sources.values() ) if uses <= 0: unbound.append(name) assert unbound == []