Repository navigation
Conversation
test_last_skew_component compared three results with == but never asserted them, and the first two lines of TestRuCu.test_applies asserted a strategy object, which is always true, in place of its applies(). Neither could fail there. Both now assert what they compute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No test gave last_skew_component a single point, though Ru2143CoreStrategy does for the extra pattern 12, so a fault that refused one point passed the whole suite. The test now checks that the last skew component of 1 is 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two tests in
tests/enumeration_strategies/test_core_strategies.pychecked nothing.test_last_skew_componentcompared three results with==but never asserted them. The first two lines ofTestRuCu.test_appliesasserted a strategy object, which is always true, in place of itsapplies(). Both tests now assert what they compute, and no code changes:A strategy object is true even for a basis it does not apply to, so
assert RuCuCoreStrategy(basis)passes whateverapplies()returns.Details
Why
A test that does not assert cannot fail.
test_last_skew_componentpassed whateverlast_skew_componentreturned.TestRuCu.test_appliespassed whateverRuCuCoreStrategyanswered for Av(2314, 3124) and Av(1234, 2314, 3124), both classes of Corollary 4.3. Now the tests check the skew components they name, and that the strategy applies to both classes.Other tests already caught some faults in these functions, so the suite as a whole was not blind there. This change makes the two tests check what their names say, for anyone who relies on them, such as the maintainers when they change these functions.
What changes
TestRuCu.test_applies: its first two lines call.applies(), as its other lines do.test_last_skew_component: its three comparisons are asserted. A fourth case gives it a permutation of one point, asRu2143CoreStrategydoes for the extra pattern 12, which no test did before.test_init_strategy, intests/enumeration_strategies/test_enumeration_strategies.py, asserts nothing either, but by design: it checks that every strategy can be built and asked on two bases without raising. It stays as it is.CHANGELOG.md, as nothing outside the tests changes.Checks
develop's counts, as the change adds no test.last_skew_component,CoreStrategy._applies_to_symmetry,RuCuCoreStrategy,zero_plus_skewindandfstrip, the two tests now kill 34 of 45, wheredevelop's versions killed 31: the three more are faults inlast_skew_component, two that the old test computed and dropped, and one that refuses a permutation of one point, which the whole suite let pass. A scan inlast_skew_componentthat starts one place late passes every test ofdevelop's file and fails the newtest_last_skew_component, which also fails whenlast_skew_componentreturns the last sum component, wheredevelop's version passed.developwith this Permuta, on both Pythons.AI assistance: written with Claude Code (Opus 5.5) as the Permuta developer, and reviewed before submission by Claude Code (Opus 5.5) as an automated reviewer; Henning Ulfarsson checked and opened it.