test(compat): make the space-in-path premise able to fail (unblocks main) - #888
Closed
fujibee wants to merge 1 commit into
Closed
test(compat): make the space-in-path premise able to fail (unblocks main)#888fujibee wants to merge 1 commit into
fujibee wants to merge 1 commit into
Conversation
`main` is red on the enforced-assertions ratchet: 639 against a baseline of 638. The count rose at fa826b7 (#771), which added [[ "$raw" == *"Application Support"* ]] as the premise for the case below it -- and a non-last `[[ ]]` cannot fail a test on bash 3.2 (#670). So the premise passed on any `raw` at all, and the assertions underneath it would have run against a value that never had the shape they are about. A premise that cannot fail is worse than no premise, because it reads as one. Uses `grep -qF`, the idiom the other #850-era cases in this tree settled on. The baseline is deliberately not bumped. The ratchet was reporting a real defect, not drift.
Owner
Author
|
Closing as a duplicate of #887, which is the one being landed: it carries CLEARED from two reviewers at the same head, and it prints what |
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.
mainis red on a required check right now, so this blocks landing for every branch.Where the extra one came from
Bisected across the commits since
v1.2.1, running the checker at each:fa826b7(#771) addedtests/test_compat_posix.bats, and with it:Why the ratchet is right and the baseline should not move
A non-last
[[ ]]cannot fail a test on bash 3.2 (#670). This one is the case'spremise — it exists to establish that the real
pson this platform handsback a path containing a space, which is the whole situation the assertions below
it are about.
Because it cannot fail, it passes for any
rawwhatsoever. On a platform whosepsreturned something else entirely, the case would sail past its own premiseand then assert against a value that never had the shape in question. The
casestatement above it already skips the platforms where the path is unreachable, so
the surviving failure mode is the quiet one: a premise that reads as checked and
is not.
That is the class the ratchet exists to catch, so the fix is the assertion, not
the number.
The change
grep -qF, the idiom the other #850-era cases in this tree settled on:Verified
The mutation is the point of the change, so it is worth stating plainly: with the
old line, replacing
Application Supportwith a string the path never containsleaves the case green. With the new line it goes red.