mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
Add regression test for trap -p
This commit is contained in:
parent
c8f92878c3
commit
07fc04465f
1 changed files with 28 additions and 0 deletions
28
tests/checks/trap_print.fish
Normal file
28
tests/checks/trap_print.fish
Normal file
|
@ -0,0 +1,28 @@
|
|||
# RUN: env fth=%fish_test_helper %fish %s
|
||||
|
||||
# These tests check how installed trap handlers are listed. Run separately from the main trap
|
||||
# handler to ensure a clean environment.
|
||||
|
||||
trap -p
|
||||
# CHECK:
|
||||
|
||||
# Validate both SIG, no-SIG, uppercase, and lowercase.
|
||||
trap "true" SIGTERM kill ExIT INT
|
||||
|
||||
trap -p
|
||||
# CHECK: # Defined via `source`
|
||||
# CHECK: function __trap_handler_EXIT --on-event fish_exit
|
||||
# CHECK: true;
|
||||
# CHECK: end
|
||||
# CHECK: # Defined via `source`
|
||||
# CHECK: function __trap_handler_INT --on-signal SIGINT
|
||||
# CHECK: true;
|
||||
# CHECK: end
|
||||
# CHECK: # Defined via `source`
|
||||
# CHECK: function __trap_handler_KILL --on-signal SIGKILL
|
||||
# CHECK: true;
|
||||
# CHECK: end
|
||||
# CHECK: # Defined via `source`
|
||||
# CHECK: function __trap_handler_TERM --on-signal SIGTERM
|
||||
# CHECK: true;
|
||||
# CHECK: end
|
Loading…
Reference in a new issue