Repository navigation
Add regression coverage for XMILE right-nested non-commutative operators - #333
Conversation
Add regression coverage for right-nested subtraction, division, and modulo in the XMILE equation printer. These cases are sensitive to associativity and must retain parentheses on the right child to preserve AST semantics. The parenthesization logic is already implemented in this branch, so this change focuses on preventing future regressions and documenting the expected string output for non-commutative operators at equal precedence.
Code ReviewReviewed the diff: SummaryThis PR adds three regression test assertions to FindingsNo bugs found. The test assertions correctly construct ASTs representing right-nested non-commutative expressions and verify the expected parenthesized output. The VerdictCorrect. The patch adds well-formed test coverage for existing parenthesization logic without modifying any production code. Existing code and tests will not break. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #333 +/- ##
==========================================
+ Coverage 79.59% 79.61% +0.01%
==========================================
Files 134 134
Lines 32650 32650
==========================================
+ Hits 25989 25993 +4
+ Misses 6661 6657 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Motivation
a - (b - c)do not lose their parentheses and change semantics.Description
test_print_eqninsrc/simlin-engine/src/ast/mod.rsthat verifyprint_eqnemitsa - (b - c),a / (b / c), anda mod (b mod c).Testing
cargo test -p simlin-engine test_print_eqn, which completed successfully.Codex Task