Measure correctness: bracket check and a 102-row tagged hand test (#12)
isotope-eval reports a balanced column next to exact and compiles, and breaks hand-test exact match down by category. eval/hand_test.jsonl grows from 32 to 102 tagged rows built from the stress-test failures in #2 and #4-#9. Closes #3 Co-authored-by: Paul Tal <[email protected]>
This commit was merged in pull request #12.
This commit is contained in:
1 parent
473a9358d6
commit
40145d1fce
3 files changed
+158
-37
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import collections
|
||||
|
||||
from isotope_typst.evaluate import balanced, read_jsonl
|
||||
from isotope_typst.validate import compiles_many
|
||||
|
||||
|
||||
def test_balanced():
|
||||
assert balanced("frac(sin(x), x)")
|
||||
assert balanced("sum_(i = 1)^n i")
|
||||
assert not balanced("(x + 1)^2 + 1)^2 + 1)^2")
|
||||
assert not balanced("(-frac(b, 2)")
|
||||
assert not balanced("x y z frac(x")
|
||||
assert not balanced("(x]")
|
||||
|
||||
|
||||
def test_hand_test_is_well_formed():
|
||||
rows = read_jsonl("eval/hand_test.jsonl")
|
||||
assert len(rows) >= 100
|
||||
assert all(set(r) == {"en", "typ", "cat"} for r in rows)
|
||||
assert all(balanced(r["typ"]) for r in rows)
|
||||
assert all(compiles_many([r["typ"] for r in rows]))
|
||||
dupes = [en for en, k in collections.Counter(r["en"] for r in rows).items() if k > 1]
|
||||
assert not dupes, dupes
|
||||
Reference in new issue
Block a user