Skip to content

Commit e217a3f

Browse files
committed
fix: add assertion for specific text in test
1 parent 8ca9d10 commit e217a3f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

python/tests/test_run_report.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_str_no_egglog_sexprs(self):
9494

9595
assert "(rewrite" not in output, f"str() still contains egglog s-expressions:\n{output}"
9696
assert "__main__" not in output, f"str() still contains mangled names:\n{output}"
97+
assert "rewrite(" in output, f"Expected 'rewrite(' in:\n{output}"
9798

9899
def test_multiple_rules(self):
99100
egraph = EGraph()
@@ -137,6 +138,8 @@ def __add__(self, other: Num) -> Num: ...
137138

138139
output = str(report)
139140
assert "__main__" not in output, f"str() still contains mangled names:\n{output}"
141+
assert "rule(" in output, f"Expected 'rule(' in:\n{output}"
142+
assert "comm" in output, f"Expected rule name 'comm' in:\n{output}"
140143

141144
def test_unnamed_rule_decl(self):
142145
egraph = EGraph()
@@ -152,6 +155,7 @@ def __add__(self, other: Num) -> Num: ...
152155

153156
output = str(report)
154157
assert "__main__" not in output, f"Unnamed RuleDecl key not translated:\n{output}"
158+
assert "rule(" in output, f"Expected 'rule(' in:\n{output}"
155159
# Should contain Python rule() syntax somewhere in the keys
156160
rule_keys = list(report.search_and_apply_time_per_rule.keys())
157161
assert len(rule_keys) > 0
@@ -173,6 +177,7 @@ def __mul__(self, other: Num) -> Num: ...
173177

174178
output = str(report)
175179
assert "__main__" not in output, f"BiRewriteDecl key not translated:\n{output}"
180+
assert "birewrite(" in output, f"Expected 'birewrite(' in:\n{output}"
176181
rule_keys = list(report.search_and_apply_time_per_rule.keys())
177182
assert len(rule_keys) > 0
178183
for key in rule_keys:

0 commit comments

Comments
 (0)