xref: /freebsd/bin/sh/tests/builtins/trap5.0 (revision fed1ca4b719c56c930f2259d80663cd34be812bb)
1# $FreeBSD$
2
3set -e
4trap - USR1
5initial=$(trap)
6trap -- -l USR1
7added=$(trap)
8[ -n "$added" ]
9trap - USR1
10second=$(trap)
11[ "$initial" = "$second" ]
12eval "$added"
13added2=$(trap)
14added3=$(trap --)
15[ "$added" = "$added2" ]
16[ "$added2" = "$added3" ]
17trap -- - USR1
18third=$(trap)
19[ "$initial" = "$third" ]
20