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