From 5f1700755f12677b608adef88c39e08df99c41f2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 10 Nov 2016 10:37:27 +0000 Subject: 39901: No EXIT trap on LHS of pipeline. There is a special case if the LHS is a shell construct. Add unit tests for both cases. --- Test/C03traps.ztst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Test') diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index 828a3d10f..c3bedb06c 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -641,6 +641,23 @@ F:Must be tested with a top-level script rather than source or function >TERM >EXIT + # Should not get "hello" in the single quotes. + ( + trap "echo hello" EXIT; + { :; } | { read line; print "'$line'"; } + ) +0:EXIT trap not called in LHS of pipeline: Shell construct on LHS +>'' +>hello + + ( + trap "echo hello" EXIT; + cat '' +>hello + %clean rm -f TRAPEXIT -- cgit 1.4.1