Skip to content

Commit

Permalink
tests/param-p: Reduce test of special parameter !
Browse files Browse the repository at this point in the history
The previous test assumed a particular process tree topology that is not
implemented by all shells. Since the process tree structure is
implementation detail, we can rely only on the wait status of the
signaled process.
  • Loading branch information
magicant committed Oct 27, 2024
1 parent 31c2c45 commit 38df925
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions tests/param-p.tst
Original file line number Diff line number Diff line change
Expand Up @@ -451,23 +451,11 @@ kill $$
echo not reached
__IN__

test_oE 'special parameter !'
mkfifo fifo
echo foo | {
trap 'echo trapped; exit 0' USR1
cat
cat fifo
}&
exec 3>fifo
echo bar >&3
kill -s USR1 $! # should kill the last process of the background pipeline
exec 3>&-
test_O -e USR1 'special parameter !'
while kill -s 0 $$; do sleep 1; done &
kill -s USR1 $!
wait $!
__IN__
foo
bar
trapped
__OUT__

# Special parameter 0 is tested in sh-p.tst
#test_oE 'special parameter 0'
Expand Down

0 comments on commit 38df925

Please sign in to comment.