Skip to content

test(compat): make the space-containing-path premise able to fail - #887

Merged
fujibee merged 1 commit into
mainfrom
fix/enforceable-assertion-compat-posix
Aug 19, 2026
Merged

test(compat): make the space-containing-path premise able to fail#887
fujibee merged 1 commit into
mainfrom
fix/enforceable-assertion-compat-posix

Conversation

@fujibee

@fujibee fujibee commented Aug 18, 2026

Copy link
Copy Markdown
Owner

main is one over its enforced-assertions baseline right now, so the enforceable assertions check fails on every branch cut from it. Two open PRs hit this before it was traced, and neither had added the line.

What happened

tests/test_compat_posix.bats:112 states the premise of its last test with a non-last [[ ]]:

[[ "$raw" == *"Application Support"* ]]

On bash 3.2 a non-last [[ ]] cannot fail the test, so the line read as a check without being one. That is exactly what the baseline counts, and it took the count from 638 to 639.

It reached main because the branch that introduced it predated the enforceable assertions job: 15 checks ran on that head, and this was not among them. CI runs the workflow as it exists on the branch, so an old enough branch is not measured by a check main requires.

The change

The premise now uses the same case/esac shape as the skip guard directly above it, and prints what ps actually reported on failure.

Positive control

Replacing the pattern with one $raw cannot match turns test 5 red and leaves the other four green:

not ok 5 compat_get_comm matches the real ps for a binary under a space-containing path
#   `return 1 ;;' failed
# ps reported [/var/folders/.../Application Support/bin/claude], which does not carry the space-containing path

check-enforced-assertions.sh: 639 before, 638 after — at the baseline. bats tests/test_compat_posix.bats: 5/5.

The premise assertion was a non-last `[[ ]]`, which cannot fail a test on
bash 3.2 -- so it stated the premise without checking it. It now uses the
same case/esac shape the skip guard above it already uses, and prints what
ps actually reported.

main is currently one over its enforced-assertions baseline because of this
line, so every branch cut from main fails that check. The count returns to
638 with this change.

Mutation: replacing the pattern with one `raw` cannot match turns test 5
red and leaves the other four green.

bats tests/test_compat_posix.bats: 5/5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant