xref: /freebsd/bin/sh/tests/builtins/trap5.0 (revision aa24f48b361effe51163877d84f1b70d32b77e04)
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