Skip to content

Commit 1f77dc0

Browse files
authored
Merge pull request #151 from akinomyoga/fix-test-__bp_install
Fix false-negative test case for __bp_install
2 parents f872f3f + 99d05b9 commit 1f77dc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/bash-preexec.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ set_exit_code_and_run_precmd() {
7474
@test "__bp_install should remove trap logic and itself from PROMPT_COMMAND" {
7575
__bp_install_after_session_init
7676

77-
[[ "$PROMPT_COMMAND" == *"trap - DEBUG"* ]] || return 1
78-
[[ "$PROMPT_COMMAND" == *"__bp_install"* ]] || return 1
77+
# Assert that before running, the command contains the install string, and
78+
# afterwards it does not
79+
[[ "$PROMPT_COMMAND" == *"$__bp_install_string"* ]] || return 1
7980

8081
eval_PROMPT_COMMAND
8182

82-
[[ "$PROMPT_COMMAND" != *"trap DEBUG"* ]] || return 1
83-
[[ "$PROMPT_COMMAND" != *"__bp_install"* ]] || return 1
83+
[[ "$PROMPT_COMMAND" != *"$__bp_install_string"* ]] || return 1
8484
}
8585

8686
@test "__bp_install should preserve an existing DEBUG trap" {

0 commit comments

Comments
 (0)