From 32786330f461d212a189caed34d567a0fa3e5c18 Mon Sep 17 00:00:00 2001 From: fujibee Date: Tue, 18 Aug 2026 19:38:16 -0700 Subject: [PATCH] test(compat): make the space-in-path premise able to fail A non-last `[[ ]]` cannot fail a bats test on bash 3.2 (#670), so this premise check asserted nothing and pushed the tree one over its enforced-assertions baseline -- 639 against 638, which is red on main today and on every branch taken from it. Measured: pointing the check at a string ps never reports turns case 5 red, which the `[[ ]]` form did not. --- tests/test_compat_posix.bats | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_compat_posix.bats b/tests/test_compat_posix.bats index be86fff0d..140025621 100644 --- a/tests/test_compat_posix.bats +++ b/tests/test_compat_posix.bats @@ -109,7 +109,9 @@ _stub_ps_printing() { esac # The real ps hands us a path with a space -- the premise of the stub above. - [[ "$raw" == *"Application Support"* ]] + # A plain command, not `[[ ]]`: a non-last `[[ ]]` cannot fail a bats test on + # bash 3.2, so as a conditional this premise check asserted nothing (#670). + grep -qF -- "Application Support" <<<"$raw" run compat_get_comm "$_PROC_PID" [ "$status" -eq 0 ]