KucLab commited on
Commit
ca75fff
·
verified ·
1 Parent(s): 500d0ee

Add tests/test_regex_gate.py

Browse files
Files changed (1) hide show
  1. tests/test_regex_gate.py +13 -0
tests/test_regex_gate.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json, subprocess, sys
2
+ from pathlib import Path
3
+
4
+ ROOT = Path(__file__).resolve().parent.parent
5
+
6
+ def test_regex_gate_passes():
7
+ r = subprocess.run([sys.executable, str(ROOT / "scripts/test_regex.py")],
8
+ capture_output=True, text=True, cwd=ROOT)
9
+ assert r.returncode == 0, r.stdout + r.stderr
10
+ rep = json.loads((ROOT / "reports/regex_gate.json").read_text())
11
+ assert rep["n_benign"] >= 200
12
+ assert rep["hard_FP"] == 0
13
+ assert rep["misses"] == []