trap16.0 revision 281718
1# $FreeBSD: head/bin/sh/tests/builtins/trap16.0 281718 2015-04-18 23:49:57Z bdrewery $ 2 3traps=$(${SH} -c 'trap "echo bad" 0; trap - 0; trap') 4[ -z "$traps" ] || exit 1 5traps=$(${SH} -c 'trap "echo bad" 0; trap "" 0; trap') 6expected_traps=$(${SH} -c 'trap "" EXIT; trap') 7[ "$traps" = "$expected_traps" ] || exit 2 8traps=$(${SH} -c 'trap "echo bad" 0; trap 0; trap') 9[ -z "$traps" ] || exit 3 10traps=$(${SH} -c 'trap "echo bad" 0; trap -- 0; trap') 11[ -z "$traps" ] || exit 4 12traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap - 0 1 2; trap') 13[ -z "$traps" ] || exit 5 14traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap "" 0 1 2; trap') 15expected_traps=$(${SH} -c 'trap "" EXIT HUP INT; trap') 16[ "$traps" = "$expected_traps" ] || exit 6 17traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap 0 1 2; trap') 18[ -z "$traps" ] || exit 7 19traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap -- 0 1 2; trap') 20[ -z "$traps" ] || exit 8 21