Skip to content

Commit 4c60358

Browse files
committed
But leave test for old macos version of bash
1 parent 64ec7e7 commit 4c60358

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/lib/preexec.bats

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ function local_setup {
6060
assert_success
6161

6262
__bp_install
63-
assert_equal "${PROMPT_COMMAND[*]}" $'__bp_precmd_invoke_cmd __bp_interactive_mode'
63+
if ((BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 1))); then
64+
assert_equal "${PROMPT_COMMAND[*]}" $'__bp_precmd_invoke_cmd __bp_interactive_mode'
65+
else
66+
assert_equal "${PROMPT_COMMAND}" $'__bp_precmd_invoke_cmd\n__bp_interactive_mode'
67+
fi
6468
}
6569

6670
@test "vendor preexec: __bp_install() with existing" {
@@ -75,7 +79,11 @@ function local_setup {
7579
assert_success
7680

7781
__bp_install
78-
assert_equal "${PROMPT_COMMAND[*]}" $'__bp_precmd_invoke_cmd\n'"$test_prompt_string"$'\n: __bp_interactive_mode'
82+
if ((BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 1))); then
83+
assert_equal "${PROMPT_COMMAND[*]}" $'__bp_precmd_invoke_cmd\n'"$test_prompt_string"$'\n: __bp_interactive_mode'
84+
else
85+
assert_equal "${PROMPT_COMMAND}" $'__bp_precmd_invoke_cmd\n'"$test_prompt_string"$'\n__bp_interactive_mode'
86+
fi
7987
}
8088

8189
@test "lib preexec: __bp_require_not_readonly()" {

0 commit comments

Comments
 (0)