import json from pathlib import Path def is_valid(equation: str) -> bool: # Basic heuristics for now until we hook into embed.py fully if " + " in equation and "=" not in equation and len(equation.split()) < 3: return False # e.g., "x + " if "/" in equation and "0" in equation.split("/")[1]: return False # e.g., "10 / 0" if "$" in equation and len(equation) == 1: return False # e.g., "$" return True def main(): path = Path("/home/allaun/Research Stack/4-Infrastructure/shim/negative_tests.json") with open(path, "r") as f: tests = json.load(f) print(f"{'Equation':<25} | {'Expected':<8} | {'Actual':<8} | {'Status'}") print("-" * 60) for test in tests: eq = test["equation"] expected = test["expected"] actual = is_valid(eq) status = "✅" if actual == expected else "❌" print(f"{eq:<25} | {str(expected):<8} | {str(actual):<8} | {status}") if __name__ == "__main__": main()