Repository navigation
Conversation
kddejong
approved these changes
Oct 20, 2026
kddejong
force-pushed
the
test/conditions-add-equivalence-coverage
branch
from
October 20, 2026 23:47
04cebf7 to
bdc2997
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4790 +/- ##
==========================================
+ Coverage 94.70% 94.72% +0.01%
==========================================
Files 439 439
Lines 15895 15895
Branches 3078 3078
==========================================
+ Hits 15053 15056 +3
+ Misses 459 458 -1
+ Partials 383 381 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: Follow-up to #4742 (#4737)
Description of changes:
#4742 was merged with Codecov reporting 91.17% patch coverage, with 3 lines in
src/cfnlint/conditions/_utils.pynot covered. This adds two tests toTestAddEquivalencethat cover them. No source changes.test_repeated_subterm_shares_one_variable: an expression whoseOr(a, b)subterm appears in two branches (Or(And(Or(a,b),c), And(Or(a,b),d))). This hits the subterm cache in_tseitin; the earlier test case was simplified by sympy before reaching it. The test asserts the encoding uses a single auxiliary variable for the shared subterm, and checks equisatisfiability against the directEquivalentencoding over all 32 assignments.test_boolean_function_without_nnf_rewrite_is_a_literal: covers the guard for aBooleanFunctionthatto_nnfleaves unchanged. Every built-in function is rewritten (Implies,Equivalent,Xor,ITE,Nand,Nor,Xnor), so the test uses a minimal custom subclass and checks that it is encoded as an atom, again against the direct encoding. The guard is kept because without it such a subclass would recurse indefinitely.With these tests,
_utils.pyhas 100% statement and branch coverage (65/65 statements, 32/32 branches).pytest test/unit/module/conditions test/unit/module/contextpasses, and ruff and isort are clean.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.