diff options
author | dgp <dgp@users.sourceforge.net> | 2010-10-06 20:21:39 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2010-10-06 20:21:39 (GMT) |
commit | 7d05f3e800ea7d43ff146b25a61e7c60c182738b (patch) | |
tree | 1afaf4d44d0e9d03a3cba15d459954e496321767 /tests/winPipe.test | |
parent | 6f2e8c77532df55d185274fbc12464f5f539d08e (diff) | |
download | tcl-7d05f3e800ea7d43ff146b25a61e7c60c182738b.zip tcl-7d05f3e800ea7d43ff146b25a61e7c60c182738b.tar.gz tcl-7d05f3e800ea7d43ff146b25a61e7c60c182738b.tar.bz2 |
* tests/winPipe.test: Test hygiene with makeFile and removeFile.
Diffstat (limited to 'tests/winPipe.test')
-rw-r--r-- | tests/winPipe.test | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/winPipe.test b/tests/winPipe.test index a2df9b6..1700fa2 100644 --- a/tests/winPipe.test +++ b/tests/winPipe.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: winPipe.test,v 1.33 2006/11/03 15:31:26 dkf Exp $ +# RCS: @(#) $Id: winPipe.test,v 1.34 2010/10/06 20:21:39 dgp Exp $ package require tcltest namespace import -force ::tcltest::* @@ -70,15 +70,15 @@ test winpipe-1.2 {32 bit comprehensive tests: from big file} {win exec cat32} { list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.3 {32 bit comprehensive tests: a little from pipe} {win nt exec cat32} { - exec [interpreter] more < little | $cat32 > $path(stdout) 2> $path(stderr) + exec [interpreter] $path(more) < $path(little) | $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.4 {32 bit comprehensive tests: a lot from pipe} {win nt exec cat32} { - exec [interpreter] more < big | $cat32 > $path(stdout) 2> $path(stderr) + exec [interpreter] $path(more) < $path(big) | $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.5 {32 bit comprehensive tests: a lot from pipe} {win 95 exec cat32} { - exec command /c type big |& $cat32 > $path(stdout) 2> $path(stderr) + exec command /c type $path(big) |& $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.6 {32 bit comprehensive tests: from console} \ @@ -173,7 +173,6 @@ test winpipe-1.22 {Checking command.com for Win95/98 hanging} {win 95 exec} { exec command.com /c dir /b set result 1 } 1 -file delete more test winpipe-4.1 {Tcl_WaitPid} {win nt exec cat32} { proc readResults {f} { @@ -187,7 +186,7 @@ test winpipe-4.1 {Tcl_WaitPid} {win nt exec cat32} { } } - set f [open "|[list $cat32] < big 2> $path(stderr)" r] + set f [open "|[list $cat32] < $path(big) 2> $path(stderr)" r] fconfigure $f -buffering none -blocking 0 fileevent $f readable "readResults $f" set x 0 @@ -236,7 +235,7 @@ set env(TEMP) c:/ test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {win exec} { set x {} set existing [glob -nocomplain c:/tcl*.tmp] - exec [interpreter] < nothing + exec [interpreter] < $path(nothing) foreach p [glob -nocomplain c:/tcl*.tmp] { if {[lsearch $existing $p] == -1} { lappend x $p @@ -249,7 +248,7 @@ test winpipe-5.2 {TclpCreateTempFile: TMP and TEMP not defined} {win exec} { set temp $env(TEMP) unset env(TMP) unset env(TEMP) - exec [interpreter] < nothing + exec [interpreter] < $path(nothing) set env(TMP) $tmp set env(TEMP) $temp set x {} @@ -258,7 +257,7 @@ test winpipe-5.3 {TclpCreateTempFile: TMP specifies non-existent directory} \ {win exec } { set tmp $env(TMP) set env(TMP) snarky - exec [interpreter] < nothing + exec [interpreter] < $path(nothing) set env(TMP) $tmp set x {} } {} @@ -268,7 +267,7 @@ test winpipe-5.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \ set temp $env(TEMP) unset env(TMP) set env(TEMP) snarky - exec [interpreter] < nothing + exec [interpreter] < $path(nothing) set env(TMP) $tmp set env(TEMP) $temp set x {} @@ -441,6 +440,12 @@ if {[catch {set env(TEMP) $env_temp}]} { } # cleanup -file delete big little stdout stderr nothing echoArgs.tcl +removeFile little +removeFile big +removeFile more +removeFile stdout +removeFile stderr +removeFile nothing +removeFile echoArgs.tcl ::tcltest::cleanupTests return |