aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2022-06-13 10:24:27 +1000
committerSteve Bennett <steveb@workware.net.au>2022-07-31 18:17:48 +1000
commit340d0a09b7b4ed64c00d86fa8076570627963059 (patch)
treef280a35b390066cf15bf2c8fadbb8ec19e8a474d /tests
parent0e8795e72c0b76fb007963714c60da72caeb0ee8 (diff)
downloadjimtcl-340d0a09b7b4ed64c00d86fa8076570627963059.zip
jimtcl-340d0a09b7b4ed64c00d86fa8076570627963059.tar.gz
jimtcl-340d0a09b7b4ed64c00d86fa8076570627963059.tar.bz2
tests: Fix SIGPIPE tests
These tests were only working accidentally (typo >$@w). In fact since open |... already provides a pipe on output there is no need to create one manually, so the first test can run under Tcl too. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r--tests/exec2.test12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/exec2.test b/tests/exec2.test
index b1d0263..ce5f24b 100644
--- a/tests/exec2.test
+++ b/tests/exec2.test
@@ -67,28 +67,22 @@ test exec2-3.1 "close pipeline return value" pipe {
list $rc $msg $status $exitcode
} {1 {child process exited abnormally} CHILDSTATUS 1}
-test exec2-3.2 "close pipeline return value" -constraints {jim pipe nomingw32} -body {
- # Create a pipe and immediately close the read end
- lassign [pipe] r w
- close $r
+test exec2-3.2 "close pipeline return value" -constraints {pipe nomingw32} -body {
# Write more than 64KB which is maximum size of the pipe buffers
# on all systems we have seen
set bigstring [string repeat a 100000]
- set f [open [list |cat << $bigstring >$@w]]
+ set f [open [list |cat << $bigstring]]
set rc [catch {close $f} msg opts]
lassign [dict get $opts -errorcode] status pid exitcode
list $rc $msg $status $exitcode
} -match glob -result {1 {child killed*} CHILDKILLED SIGPIPE}
test exec2-3.3 "close pipeline with SIGPIPE blocked" -constraints {pipe signal nomingw32} -body {
- # Create a pipe and immediately close the read end
- lassign [pipe] r w
- close $r
signal block SIGPIPE
# Write more than 64KB which is maximum size of the pipe buffers
# on all systems we have seen
set bigstring [string repeat a 100000]
- set f [open [list |cat << $bigstring >$@w 2>/dev/null]]
+ set f [open [list |cat << $bigstring 2>/dev/null]]
set rc [catch {close $f} msg opts]
lassign [dict get $opts -errorcode] status pid exitcode
list $rc $msg $status $exitcode