From 8a8eb5de873e1c08cb226fd610dc1f05ddd3820f Mon Sep 17 00:00:00 2001 From: fujibee Date: Tue, 18 Aug 2026 16:37:01 -0700 Subject: [PATCH] test(compat): make the space-containing-path premise able to fail 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. --- tests/test_compat_posix.bats | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_compat_posix.bats b/tests/test_compat_posix.bats index be86fff0d..b5cc0e606 100644 --- a/tests/test_compat_posix.bats +++ b/tests/test_compat_posix.bats @@ -109,7 +109,13 @@ _stub_ps_printing() { esac # The real ps hands us a path with a space -- the premise of the stub above. - [[ "$raw" == *"Application Support"* ]] + # A non-last `[[ ]]` cannot fail the test on bash 3.2, so this states the + # premise the way the skip guard above already does. + case "$raw" in + *"Application Support"*) ;; + *) echo "ps reported [$raw], which does not carry the space-containing path" >&2 + return 1 ;; + esac run compat_get_comm "$_PROC_PID" [ "$status" -eq 0 ]