Commit dc66953
committed
test(rewrite): systematic coverage matrix for assertion rewriting
The rewriter is tested through its failure messages, one regression test
per issue. That makes it hard to say whether a change improved anything:
there is no place that records what the rewriter cannot do yet.
Add a matrix over expression types with four axes -- introspection depth,
semantic equivalence, single evaluation, and evaluation order -- and
record every known gap as a strict xfail tagged with a group name. A
change that closes one names the group and flips its markers; strictness
means it cannot forget.
The evaluation-order axis is new. Comparing pass/fail is not enough: an
operand read after a later walrus operator rebound its name runs exactly
once and can still fail the assertion, having compared the wrong value.
assert_evaluation_order() compares what check() returns, because the
fragile operand is a bare name -- wrapping it in a call to observe it
would hoist it and hide the bug.
Behaviour is unchanged; this only describes it.1 parent f306da7 commit dc66953
1 file changed
Lines changed: 1541 additions & 0 deletions
0 commit comments