Skip to content

Commit

Permalink
Merge pull request #151 from akinomyoga/fix-test-__bp_install
Browse files Browse the repository at this point in the history
Fix false-negative test case for __bp_install
  • Loading branch information
dimo414 authored Feb 4, 2024
2 parents f872f3f + 99d05b9 commit 1f77dc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/bash-preexec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ set_exit_code_and_run_precmd() {
@test "__bp_install should remove trap logic and itself from PROMPT_COMMAND" {
__bp_install_after_session_init

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

eval_PROMPT_COMMAND

[[ "$PROMPT_COMMAND" != *"trap DEBUG"* ]] || return 1
[[ "$PROMPT_COMMAND" != *"__bp_install"* ]] || return 1
[[ "$PROMPT_COMMAND" != *"$__bp_install_string"* ]] || return 1
}

@test "__bp_install should preserve an existing DEBUG trap" {
Expand Down

0 comments on commit 1f77dc0

Please sign in to comment.