Fix tests that assert the wrong thing - #93
Merged
Merged
Conversation
Each of these tests passed while asserting something other than what its name claimed, so a regression in the code under test wouldn't have failed the suite. Every case was confirmed by a mutation that survived the full suite before this change and fails after it. The page parser's string branch was unreachable: `parse()` validates first, and Joi coerces a numeric string to a number. The operand dates to the initial commit and was carried through the `is` removal mechanically. Removing it leaves coverage at 100%. The validator tests now assert the validated values in the returned map, rather than only that a `Map` came back. That write-back is what turns `filter[x][is]=null` into SQL `is null`. Page write-back still needs an end-to-end assertion. Co-Authored-By: Claude Opus 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.
Each of these tests passed while asserting something other than what its
name claimed, so a regression in the code under test wouldn't have failed
the suite. Every case was confirmed by a mutation that survived the full
suite before this change and fails after it.
The page parser's string branch was unreachable:
parse()validates first,and Joi coerces a numeric string to a number. The operand dates to the
initial commit and was carried through the
isremoval mechanically.Removing it leaves coverage at 100%.
The validator tests now assert the validated values in the returned map,
rather than only that a
Mapcame back. That write-back is what turnsfilter[x][is]=nullinto SQLis null. Page write-back still needs anend-to-end assertion, which is tracked separately along with the rest of
the missing coverage found in the same audit.
🤖 Generated with Claude Code