Skip to content

Commit

Permalink
Use $__bp_install_string for a robust test case
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 4, 2024
1 parent 2a4ac8f commit 8913ea5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/bash-preexec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ 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
[[ "$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 8913ea5

Please sign in to comment.