From df6d45b4f6b62d1991c8aee5e5df8f841a28fb1f Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 7 Oct 2003 21:45:38 +0000 Subject: * tests/cmdAH.test: * tests/exec.test: Corrected temporary file management * tests/fileSystem.test: issues uncovered by -debug 1 test * tests/io.test: operations. Also backported some * tests/ioCmd.test: other fixes from the HEAD. * tests/main.test: * tests/pid.test: [Bugs 675605, 675655, 675659] * tests/socket.test: * tests/source.test: --- ChangeLog | 11 +- tests/cmdAH.test | 16 +- tests/exec.test | 8 +- tests/fileSystem.test | 1 - tests/io.test | 487 +++++++++++++++++++++++++------------------------- tests/ioCmd.test | 36 ++-- tests/main.test | 8 +- tests/socket.test | 64 +++---- tests/source.test | 10 +- 9 files changed, 322 insertions(+), 319 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b70790..69bc280 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,14 @@ 2003-10-07 Don Porter - * tests/pid.test: Corrected temporary file management issues - uncovered by -debug 1 test operations. [Bug 675655] + * tests/cmdAH.test: + * tests/exec.test: Corrected temporary file management + * tests/fileSystem.test: issues uncovered by -debug 1 test + * tests/io.test: operations. Also backported some + * tests/ioCmd.test: other fixes from the HEAD. + * tests/main.test: + * tests/pid.test: [Bugs 675605, 675655, 675659] + * tests/socket.test: + * tests/source.test: * tests/fCmd.test: Run tests with the [temporaryDirectory] as the current directory, so that tests can depend on ability to write diff --git a/tests/cmdAH.test b/tests/cmdAH.test index ae38606..436425b 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: cmdAH.test,v 1.36 2003/09/16 16:06:35 vincentdarley Exp $ +# RCS: @(#) $Id: cmdAH.test,v 1.37 2003/10/07 21:45:38 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 @@ -1465,15 +1465,17 @@ rename waitForEvenSecondForFAT {} test cmdAH-25.1 {Tcl_FileObjCmd: owned} { list [catch {file owned a b} msg] $msg } {1 {wrong # args: should be "file owned name"}} -test cmdAH-25.2 {Tcl_FileObjCmd: owned} { - if {$tcl_platform(platform) eq "unix"} { +test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints {!unix} -body { + file owned $gorpfile +} -result 1 +test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints {unix} -setup { # Avoid problems with AFS set tmpfile [makeFile "data" touch.me /tmp] +} -body { file owned $tmpfile - } else { - file owned $gorpfile - } -} 1 +} -cleanup { + removeFile touch.me /tmp +} -result 1 test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unixOnly notRoot} { file owned / } 0 diff --git a/tests/exec.test b/tests/exec.test index fd80dcf..91ce220 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: exec.test,v 1.16 2003/02/04 18:23:35 vincentdarley Exp $ +# RCS: @(#) $Id: exec.test,v 1.17 2003/10/07 21:45:38 dgp Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -138,7 +138,7 @@ test exec-2.6 {redirecting input from immediate source, with UTF} {exec} { # I/O redirection: output to file. set path(gorp.file) [makeFile {} gorp.file] -removeFile gorp.file +file delete $path(gorp.file) test exec-3.1 {redirecting output to file} {exec} { exec [interpreter] $path(echo) "Some simple words" > $path(gorp.file) @@ -179,7 +179,7 @@ test exec-3.7 {redirecting output to file} {exec} { # I/O redirection: output and stderr to file. -removeFile gorp.file +file delete $path(gorp.file) test exec-4.1 {redirecting output and stderr to file} {exec} { exec [interpreter] "$path(echo)" "test output" >& $path(gorp.file) @@ -264,7 +264,7 @@ test exec-6.3 {redirecting stderr through a pipeline} {exec stdio} { # I/O redirection: combinations. set path(gorp.file2) [makeFile {} gorp.file2] -removeFile gorp.file2 +file delete $path(gorp.file2) test exec-7.1 {multiple I/O redirections} {exec} { exec << "command input" > $path(gorp.file2) [interpreter] $path(cat) < $path(gorp.file) diff --git a/tests/fileSystem.test b/tests/fileSystem.test index ad749ce..b934aed 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -459,7 +459,6 @@ test filesystem-8.2 {relative path objects and use of pwd} { cd .. removeFile [file join abc foo] removeDirectory abc - removeDirectory def cd $origdir set res } {1} diff --git a/tests/io.test b/tests/io.test index 525baf8..53086da 100644 --- a/tests/io.test +++ b/tests/io.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: io.test,v 1.46 2003/10/07 14:58:29 dgp Exp $ +# RCS: @(#) $Id: io.test,v 1.47 2003/10/07 21:45:39 dgp Exp $ if {[catch {package require tcltest 2}]} { puts stderr "Skipping tests in [info script]. tcltest 2 required." @@ -38,9 +38,6 @@ testConstraint fcopy [llength [info commands fcopy]] # particular, many file systems do not support large-files... testConstraint largefileSupport 0 -removeFile test1 -removeFile pipe - # set up a long data file for some of the following tests set path(longfile) [makeFile {} longfile] @@ -1674,8 +1671,8 @@ test io-14.7 {Tcl_GetChannel: stdio name translation} { set path(script) [makeFile {} script] test io-14.8 {reuse of stdio special channels} {stdio openpipe} { - removeFile script - removeFile test1 + file delete $path(script) + file delete $path(test1) set f [open $path(script) w] puts $f [format { close stderr @@ -1693,8 +1690,8 @@ test io-14.8 {reuse of stdio special channels} {stdio openpipe} { } hello test io-14.9 {reuse of stdio special channels} {stdio openpipe fileevent} { - removeFile script - removeFile test1 + file delete $path(script) + file delete $path(test1) set f [open $path(script) w] puts $f { array set path [lindex $argv 0] @@ -1763,7 +1760,7 @@ test io-17.3 {GetChannelTable, DeleteChannelTable on std handles} {testchannel} } {0 1 0} test io-18.1 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { - removeFile test1 + file delete $path(test1) set l "" set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] @@ -1777,7 +1774,7 @@ test io-18.1 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { [list 1 [format "can not find channel named \"%s\"" $f]] } 0 test io-18.2 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { - removeFile test1 + file delete $path(test1) set l "" set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] @@ -1798,7 +1795,7 @@ test io-18.2 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { [list 1 2 1 1 [format "can not find channel named \"%s\"" $f]] } 0 test io-18.3 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { - removeFile test1 + file delete $path(test1) set l "" set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] @@ -1821,7 +1818,7 @@ test io-19.1 {Tcl_GetChannel->Tcl_GetStdChannel, standard handles} { eof stdin } 0 test io-19.2 {testing Tcl_GetChannel, user opened handle} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] set x [eof $f] close $f @@ -1831,7 +1828,7 @@ test io-19.3 {Tcl_GetChannel, channel not found} { list [catch {eof file34} msg] $msg } {1 {can not find channel named "file34"}} test io-19.4 {Tcl_CreateChannel, insertion into channel table} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] set l "" lappend l [eof $f] @@ -1905,7 +1902,7 @@ test io-22.1 {Tcl_GetChannelMode} { } {} test io-23.1 {Tcl_GetChannelName} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] set n [testchannel name $f] close $f @@ -1913,7 +1910,7 @@ test io-23.1 {Tcl_GetChannelName} {testchannel} { } 0 test io-24.1 {Tcl_GetChannelType} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] set t [testchannel type $f] close $f @@ -1934,7 +1931,7 @@ test io-25.1 {Tcl_GetChannelHandle, input} {testchannel} { set l } {10 11} test io-25.2 {Tcl_GetChannelHandle, output} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello @@ -1945,7 +1942,7 @@ test io-25.2 {Tcl_GetChannelHandle, output} {testchannel} { lappend l [testchannel outputbuffered $f] lappend l [tell $f] close $f - removeFile test1 + file delete $path(test1) set l } {6 6 0 6} @@ -1961,7 +1958,7 @@ test io-26.1 {Tcl_GetChannelInstanceData} {stdio openpipe} { # Test flushing. The functions tested here are FlushChannel. test io-27.1 {FlushChannel, no output buffered} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] flush $f set s [file size $path(test1)] @@ -1969,7 +1966,7 @@ test io-27.1 {FlushChannel, no output buffered} { set s } 0 test io-27.2 {FlushChannel, some output buffered} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set l "" @@ -1982,7 +1979,7 @@ test io-27.2 {FlushChannel, some output buffered} { set l } {0 6 6} test io-27.3 {FlushChannel, implicit flush on close} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set l "" @@ -1993,7 +1990,7 @@ test io-27.3 {FlushChannel, implicit flush on close} { set l } {0 6} test io-27.4 {FlushChannel, implicit flush when buffer fills} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} fconfigure $f -buffersize 60 @@ -2010,7 +2007,7 @@ test io-27.4 {FlushChannel, implicit flush when buffer fills} { } {0 60 72} test io-27.5 {FlushChannel, implicit flush when buffer fills and on close} \ {unixOrPc} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffersize 60 -eofchar {} set l "" @@ -2029,8 +2026,8 @@ set path(output) [makeFile {} output] test io-27.6 {FlushChannel, async flushing, async close} \ {stdio asyncPipeClose openpipe} { - removeFile pipe - removeFile output + file delete $path(pipe) + file delete $path(output) set f [open $path(pipe) w] puts $f [format { set f [open "%s" w] @@ -2068,7 +2065,7 @@ test io-27.6 {FlushChannel, async flushing, async close} \ # Tests closing a channel. The functions tested are CloseChannel and Tcl_Close. test io-28.1 {CloseChannel called when all references are dropped} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] interp create x interp share "" $f x @@ -2081,7 +2078,7 @@ test io-28.1 {CloseChannel called when all references are dropped} {testchannel} set l } {2 1} test io-28.2 {CloseChannel called when all references are dropped} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] interp create x interp share "" $f x @@ -2097,8 +2094,8 @@ test io-28.2 {CloseChannel called when all references are dropped} { } abcdef test io-28.3 {CloseChannel, not called before output queue is empty} \ {stdio asyncPipeClose nonPortable openpipe} { - removeFile pipe - removeFile output + file delete $path(pipe) + file delete $path(output) set f [open $path(pipe) w] puts $f { @@ -2142,7 +2139,7 @@ test io-28.3 {CloseChannel, not called before output queue is empty} \ } } ok test io-28.4 {Tcl_Close} {testchannel} { - removeFile test1 + file delete $path(test1) set l "" lappend l [lsort [testchannel open]] set f [open $path(test1) w] @@ -2155,7 +2152,7 @@ test io-28.4 {Tcl_Close} {testchannel} { string compare $l $x } 0 test io-28.5 {Tcl_Close vs standard handles} {stdio unixOnly testchannel openpipe} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { close stdin @@ -2172,7 +2169,7 @@ test io-29.1 {Tcl_WriteChars, channel not writable} { list [catch {puts stdin hello} msg] $msg } {1 {channel "stdin" wasn't opened for writing}} test io-29.2 {Tcl_WriteChars, empty string} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -eofchar {} puts -nonewline $f "" @@ -2180,7 +2177,7 @@ test io-29.2 {Tcl_WriteChars, empty string} { file size $path(test1) } 0 test io-29.3 {Tcl_WriteChars, nonempty string} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -eofchar {} puts -nonewline $f hello @@ -2188,7 +2185,7 @@ test io-29.3 {Tcl_WriteChars, nonempty string} { file size $path(test1) } 5 test io-29.4 {Tcl_WriteChars, buffering in full buffering mode} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering full -eofchar {} puts $f hello @@ -2202,7 +2199,7 @@ test io-29.4 {Tcl_WriteChars, buffering in full buffering mode} {testchannel} { set l } {6 0 0 6} test io-29.5 {Tcl_WriteChars, buffering in line buffering mode} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering line -eofchar {} puts -nonewline $f hello @@ -2216,7 +2213,7 @@ test io-29.5 {Tcl_WriteChars, buffering in line buffering mode} {testchannel} { set l } {5 0 0 11} test io-29.6 {Tcl_WriteChars, buffering in no buffering mode} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering none -eofchar {} puts -nonewline $f hello @@ -2231,7 +2228,7 @@ test io-29.6 {Tcl_WriteChars, buffering in no buffering mode} {testchannel} { } {0 5 0 11} test io-29.7 {Tcl_Flush, full buffering} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering full -eofchar {} puts -nonewline $f hello @@ -2248,7 +2245,7 @@ test io-29.7 {Tcl_Flush, full buffering} {testchannel} { set l } {5 0 11 0 0 11} test io-29.8 {Tcl_Flush, full buffering} {testchannel} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering line puts -nonewline $f hello @@ -2271,7 +2268,7 @@ test io-29.9 {Tcl_Flush, channel not writable} { list [catch {flush stdin} msg] $msg } {1 {channel "stdin" wasn't opened for writing}} test io-29.10 {Tcl_WriteChars, looping and buffering} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} set f2 [open $path(longfile) r] @@ -2283,7 +2280,7 @@ test io-29.10 {Tcl_WriteChars, looping and buffering} { file size $path(test1) } 387 test io-29.11 {Tcl_WriteChars, no newline, implicit flush} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -eofchar {} set f2 [open $path(longfile) r] @@ -2295,8 +2292,8 @@ test io-29.11 {Tcl_WriteChars, no newline, implicit flush} { file size $path(test1) } 377 test io-29.12 {Tcl_WriteChars on a pipe} {stdio openpipe} { - removeFile test1 - removeFile pipe + file delete $path(test1) + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 [format { set f1 [open "%s" r] @@ -2320,8 +2317,8 @@ test io-29.12 {Tcl_WriteChars on a pipe} {stdio openpipe} { set y } ok test io-29.13 {Tcl_WriteChars to a pipe, line buffered} {stdio openpipe} { - removeFile test1 - removeFile pipe + file delete $path(test1) + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { puts [gets stdin] @@ -2349,7 +2346,7 @@ test io-29.13 {Tcl_WriteChars to a pipe, line buffered} {stdio openpipe} { set y } ok test io-29.14 {Tcl_WriteChars, buffering and implicit flush at close} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "Text1" puts -nonewline $f " Text 2" @@ -2361,7 +2358,7 @@ test io-29.14 {Tcl_WriteChars, buffering and implicit flush at close} { set x } {Text1 Text 2 Text 3} test io-29.15 {Tcl_Flush, channel not open for writing} { - removeFile test1 + file delete $path(test1) set fd [open $path(test1) w] close $fd set fd [open $path(test1) r] @@ -2378,7 +2375,7 @@ test io-29.16 {Tcl_Flush on pipe opened only for reading} {stdio openpipe} { [list 1 "channel \"$fd\" wasn't opened for writing"] } 0 test io-29.17 {Tcl_WriteChars buffers, then Tcl_Flush flushes} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 hello @@ -2390,7 +2387,7 @@ test io-29.17 {Tcl_WriteChars buffers, then Tcl_Flush flushes} { set x } 18 test io-29.18 {Tcl_WriteChars and Tcl_Flush intermixed} { - removeFile test1 + file delete $path(test1) set x "" set f1 [open $path(test1) w] fconfigure $f1 -translation lf @@ -2409,7 +2406,7 @@ test io-29.18 {Tcl_WriteChars and Tcl_Flush intermixed} { set x } {18 24 30} test io-29.19 {Explicit and implicit flushes} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} set x "" @@ -2427,7 +2424,7 @@ test io-29.19 {Explicit and implicit flushes} { set x } {18 24 30} test io-29.20 {Implicit flush when buffer is full} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} set line "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" @@ -2445,7 +2442,7 @@ test io-29.20 {Implicit flush when buffer is full} { set z } {4096 12288 12600} test io-29.21 {Tcl_Flush to pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {set x [read stdin 6]} puts $f1 {set cnt [string length $x]} @@ -2459,7 +2456,7 @@ test io-29.21 {Tcl_Flush to pipe} {stdio openpipe} { set x } "read 6 characters" test io-29.22 {Tcl_Flush called at other end of pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { fconfigure stdout -buffering full @@ -2482,7 +2479,7 @@ test io-29.22 {Tcl_Flush called at other end of pipe} {stdio openpipe} { set x } {hello hello bye} test io-29.23 {Tcl_Flush and line buffering at end of pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { puts hello @@ -2517,7 +2514,7 @@ test io-29.24 {Tcl_WriteChars and Tcl_Flush move end of file} { set x } "{} {Line 1\nLine 2}" test io-29.25 {Implicit flush with Tcl_Flush to command pipelines} {stdio openpipe fileevent} { - removeFile test3 + file delete $path(test3) set f [open "|[list [interpreter] $path(cat) | [interpreter] $path(cat) > $path(test3)]" w] puts $f "Line 1" puts $f "Line 2" @@ -2537,7 +2534,7 @@ test io-29.26 {Tcl_Flush, Tcl_Write on bidirectional pipelines} {stdio unixExecs set x } {Line1} test io-29.27 {Tcl_Flush on closed pipeline} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f [open $path(pipe) w] puts $f {exit} close $f @@ -2565,7 +2562,7 @@ test io-29.27 {Tcl_Flush on closed pipeline} {stdio openpipe} { string tolower $x } {1 {error flushing "": broken pipe} {posix epipe {broken pipe}}} test io-29.28 {Tcl_WriteChars, lf mode} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} puts $f hello\nthere\nand\nhere @@ -2575,7 +2572,7 @@ test io-29.28 {Tcl_WriteChars, lf mode} { set s } 21 test io-29.29 {Tcl_WriteChars, cr mode} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar {} puts $f hello\nthere\nand\nhere @@ -2583,7 +2580,7 @@ test io-29.29 {Tcl_WriteChars, cr mode} { file size $path(test1) } 21 test io-29.30 {Tcl_WriteChars, crlf mode} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar {} puts $f hello\nthere\nand\nhere @@ -2591,8 +2588,8 @@ test io-29.30 {Tcl_WriteChars, crlf mode} { file size $path(test1) } 25 test io-29.31 {Tcl_WriteChars, background flush} {stdio openpipe} { - removeFile pipe - removeFile output + file delete $path(pipe) + file delete $path(output) set f [open $path(pipe) w] puts $f [format {set f [open "%s" w]} $path(output)] puts $f {fconfigure $f -translation lf} @@ -2628,8 +2625,8 @@ test io-29.31 {Tcl_WriteChars, background flush} {stdio openpipe} { } ok test io-29.32 {Tcl_WriteChars, background flush to slow reader} \ {stdio asyncPipeClose openpipe} { - catch {removeFile pipe} - catch {removeFile output} + file delete $path(pipe) + file delete $path(output) set f [open $path(pipe) w] puts $f [format {set f [open {%s} w]} $path(output)] puts $f {fconfigure $f -translation lf} @@ -2762,7 +2759,7 @@ test io-29.35 {Tcl_Close vs fileevent vs multiple interpreters} {socket tempNotM # Test end of line translations. Procedures tested are Tcl_Write, Tcl_Read. test io-30.1 {Tcl_Write lf, Tcl_Read lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -2774,7 +2771,7 @@ test io-30.1 {Tcl_Write lf, Tcl_Read lf} { set x } "hello\nthere\nand\nhere\n" test io-30.2 {Tcl_Write lf, Tcl_Read cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -2786,7 +2783,7 @@ test io-30.2 {Tcl_Write lf, Tcl_Read cr} { set x } "hello\nthere\nand\nhere\n" test io-30.3 {Tcl_Write lf, Tcl_Read crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -2798,7 +2795,7 @@ test io-30.3 {Tcl_Write lf, Tcl_Read crlf} { set x } "hello\nthere\nand\nhere\n" test io-30.4 {Tcl_Write cr, Tcl_Read cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -2810,7 +2807,7 @@ test io-30.4 {Tcl_Write cr, Tcl_Read cr} { set x } "hello\nthere\nand\nhere\n" test io-30.5 {Tcl_Write cr, Tcl_Read lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -2822,7 +2819,7 @@ test io-30.5 {Tcl_Write cr, Tcl_Read lf} { set x } "hello\rthere\rand\rhere\r" test io-30.6 {Tcl_Write cr, Tcl_Read crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -2834,7 +2831,7 @@ test io-30.6 {Tcl_Write cr, Tcl_Read crlf} { set x } "hello\rthere\rand\rhere\r" test io-30.7 {Tcl_Write crlf, Tcl_Read crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -2846,7 +2843,7 @@ test io-30.7 {Tcl_Write crlf, Tcl_Read crlf} { set x } "hello\nthere\nand\nhere\n" test io-30.8 {Tcl_Write crlf, Tcl_Read lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -2858,7 +2855,7 @@ test io-30.8 {Tcl_Write crlf, Tcl_Read lf} { set x } "hello\r\nthere\r\nand\r\nhere\r\n" test io-30.9 {Tcl_Write crlf, Tcl_Read cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -2870,7 +2867,7 @@ test io-30.9 {Tcl_Write crlf, Tcl_Read cr} { set x } "hello\n\nthere\n\nand\n\nhere\n\n" test io-30.10 {Tcl_Write lf, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -2886,7 +2883,7 @@ and here } auto} test io-30.11 {Tcl_Write cr, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -2902,7 +2899,7 @@ and here } auto} test io-30.12 {Tcl_Write crlf, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -2919,7 +2916,7 @@ here } auto} test io-30.13 {Tcl_Write crlf on block boundary, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf @@ -2936,7 +2933,7 @@ test io-30.13 {Tcl_Write crlf on block boundary, Tcl_Read auto} { } [expr 700*15+1] test io-30.14 {Tcl_Write crlf on block boundary, Tcl_Read crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf @@ -2953,7 +2950,7 @@ test io-30.14 {Tcl_Write crlf on block boundary, Tcl_Read crlf} { } [expr 700*15+1] test io-30.15 {Tcl_Write mixed, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\rhere @@ -2969,7 +2966,7 @@ and here } test io-30.16 {Tcl_Write ^Z at end, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\nand\rhere\n\x1a @@ -2985,7 +2982,7 @@ and here } test io-30.17 {Tcl_Write, implicit ^Z at end, Tcl_Read auto} {pcOnly} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -eofchar \x1a -translation lf puts $f hello\nthere\nand\rhere @@ -3001,7 +2998,7 @@ and here } test io-30.18 {Tcl_Write, ^Z in middle, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] @@ -3021,7 +3018,7 @@ test io-30.18 {Tcl_Write, ^Z in middle, Tcl_Read auto} { set l } {abc def 0 {} 1 {} 1} test io-30.19 {Tcl_Write, ^Z no newline in middle, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] @@ -3041,7 +3038,7 @@ test io-30.19 {Tcl_Write, ^Z no newline in middle, Tcl_Read auto} { set l } {abc def 0 {} 1 {} 1} test io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set s [format "abc\ndef\n%cghi\nqrs" 26] @@ -3063,7 +3060,7 @@ test io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} { set l } "abc def 0 \x1aghi 0 qrs 0 {} 1" test io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set s [format "abc\ndef\n%cghi\nqrs" 26] @@ -3081,7 +3078,7 @@ test io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} { set l } {0 1 {} 1} test io-30.22 {Tcl_Write, ^Z in middle ignored, Tcl_Read crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set s [format "abc\ndef\n%cghi\nqrs" 26] @@ -3099,7 +3096,7 @@ test io-30.22 {Tcl_Write, ^Z in middle ignored, Tcl_Read crlf} { set l } {0 1 {} 1} test io-30.23 {Tcl_Write lf, ^Z in middle, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format abc\ndef\n%cqrs\ntuv 26] @@ -3113,7 +3110,7 @@ test io-30.23 {Tcl_Write lf, ^Z in middle, Tcl_Read auto} { list $c $e } {8 1} test io-30.24 {Tcl_Write lf, ^Z in middle, Tcl_Read lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format abc\ndef\n%cqrs\ntuv 26] @@ -3127,7 +3124,7 @@ test io-30.24 {Tcl_Write lf, ^Z in middle, Tcl_Read lf} { list $c $e } {8 1} test io-30.25 {Tcl_Write cr, ^Z in middle, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format abc\ndef\n%cqrs\ntuv 26] @@ -3141,7 +3138,7 @@ test io-30.25 {Tcl_Write cr, ^Z in middle, Tcl_Read auto} { list $c $e } {8 1} test io-30.26 {Tcl_Write cr, ^Z in middle, Tcl_Read cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format abc\ndef\n%cqrs\ntuv 26] @@ -3155,7 +3152,7 @@ test io-30.26 {Tcl_Write cr, ^Z in middle, Tcl_Read cr} { list $c $e } {8 1} test io-30.27 {Tcl_Write crlf, ^Z in middle, Tcl_Read auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format abc\ndef\n%cqrs\ntuv 26] @@ -3169,7 +3166,7 @@ test io-30.27 {Tcl_Write crlf, ^Z in middle, Tcl_Read auto} { list $c $e } {8 1} test io-30.28 {Tcl_Write crlf, ^Z in middle, Tcl_Read crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format abc\ndef\n%cqrs\ntuv 26] @@ -3186,7 +3183,7 @@ test io-30.28 {Tcl_Write crlf, ^Z in middle, Tcl_Read crlf} { # Test end of line translations. Functions tested are Tcl_Write and Tcl_Gets. test io-31.1 {Tcl_Write lf, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -3203,7 +3200,7 @@ test io-31.1 {Tcl_Write lf, Tcl_Gets auto} { set l } {hello 6 auto there 12 auto} test io-31.2 {Tcl_Write cr, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -3220,7 +3217,7 @@ test io-31.2 {Tcl_Write cr, Tcl_Gets auto} { set l } {hello 6 auto there 12 auto} test io-31.3 {Tcl_Write crlf, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -3237,7 +3234,7 @@ test io-31.3 {Tcl_Write crlf, Tcl_Gets auto} { set l } {hello 7 auto there 14 auto} test io-31.4 {Tcl_Write lf, Tcl_Gets lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -3255,7 +3252,7 @@ test io-31.4 {Tcl_Write lf, Tcl_Gets lf} { set l } {hello 6 lf there 12 lf} test io-31.5 {Tcl_Write lf, Tcl_Gets cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -3275,7 +3272,7 @@ test io-31.5 {Tcl_Write lf, Tcl_Gets cr} { set l } {21 21 cr 1 {} 21 cr 1} test io-31.6 {Tcl_Write lf, Tcl_Gets crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere @@ -3295,7 +3292,7 @@ test io-31.6 {Tcl_Write lf, Tcl_Gets crlf} { set l } {21 21 crlf 1 {} 21 crlf 1} test io-31.7 {Tcl_Write cr, Tcl_Gets cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -3315,7 +3312,7 @@ test io-31.7 {Tcl_Write cr, Tcl_Gets cr} { set l } {hello 6 cr 0 there 12 cr 0} test io-31.8 {Tcl_Write cr, Tcl_Gets lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -3335,7 +3332,7 @@ test io-31.8 {Tcl_Write cr, Tcl_Gets lf} { set l } {21 21 lf 1 {} 21 lf 1} test io-31.9 {Tcl_Write cr, Tcl_Gets crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere @@ -3355,7 +3352,7 @@ test io-31.9 {Tcl_Write cr, Tcl_Gets crlf} { set l } {21 21 crlf 1 {} 21 crlf 1} test io-31.10 {Tcl_Write crlf, Tcl_Gets crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -3375,7 +3372,7 @@ test io-31.10 {Tcl_Write crlf, Tcl_Gets crlf} { set l } {hello 7 crlf 0 there 14 crlf 0} test io-31.11 {Tcl_Write crlf, Tcl_Gets cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -3395,7 +3392,7 @@ test io-31.11 {Tcl_Write crlf, Tcl_Gets cr} { set l } {hello 6 cr 0 6 13 cr 0} test io-31.12 {Tcl_Write crlf, Tcl_Gets lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere @@ -3415,7 +3412,7 @@ test io-31.12 {Tcl_Write crlf, Tcl_Gets lf} { set l } {6 7 lf 0 6 14 lf 0} test io-31.13 {binary mode is synonym of lf mode} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation binary set x [fconfigure $f -translation] @@ -3427,7 +3424,7 @@ test io-31.13 {binary mode is synonym of lf mode} { # not supoprted. # test io-31.14 {Tcl_Write mixed, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\rand\r\nhere @@ -3446,7 +3443,7 @@ test io-31.14 {Tcl_Write mixed, Tcl_Gets auto} { set l } {hello there and here 0 {} 1} test io-31.15 {Tcl_Write mixed, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\rand\r\nhere\r @@ -3465,7 +3462,7 @@ test io-31.15 {Tcl_Write mixed, Tcl_Gets auto} { set l } {hello there and here 0 {} 1} test io-31.16 {Tcl_Write mixed, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\rand\r\nhere\n @@ -3483,7 +3480,7 @@ test io-31.16 {Tcl_Write mixed, Tcl_Gets auto} { set l } {hello there and here 0 {} 1} test io-31.17 {Tcl_Write mixed, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\rand\r\nhere\r\n @@ -3502,7 +3499,7 @@ test io-31.17 {Tcl_Write mixed, Tcl_Gets auto} { set l } {hello there and here 0 {} 1} test io-31.18 {Tcl_Write ^Z at end, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "hello\nthere\nand\rhere\n\%c" 26] @@ -3522,7 +3519,7 @@ test io-31.18 {Tcl_Write ^Z at end, Tcl_Gets auto} { set l } {hello there and here 0 {} 1} test io-31.19 {Tcl_Write, implicit ^Z at end, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -eofchar \x1a -translation lf puts $f hello\nthere\nand\rhere @@ -3541,7 +3538,7 @@ test io-31.19 {Tcl_Write, implicit ^Z at end, Tcl_Gets auto} { set l } {hello there and here 0 {} 1} test io-31.20 {Tcl_Write, ^Z in middle, Tcl_Gets auto, eofChar} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3560,7 +3557,7 @@ test io-31.20 {Tcl_Write, ^Z in middle, Tcl_Gets auto, eofChar} { set l } {abc def 0 {} 1} test io-31.21 {Tcl_Write, no newline ^Z in middle, Tcl_Gets auto, eofChar} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3578,7 +3575,7 @@ test io-31.21 {Tcl_Write, no newline ^Z in middle, Tcl_Gets auto, eofChar} { set l } {abc def 0 {} 1} test io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3600,7 +3597,7 @@ test io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} { set l } "abc def 0 \x1aqrs 0 tuv 0 {} 1" test io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3622,7 +3619,7 @@ test io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} { set l } "abc def 0 \x1aqrs 0 tuv 0 {} 1" test io-31.24 {Tcl_Write, ^Z in middle ignored, Tcl_Gets crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3644,7 +3641,7 @@ test io-31.24 {Tcl_Write, ^Z in middle ignored, Tcl_Gets crlf} { set l } "abc def 0 \x1aqrs 0 tuv 0 {} 1" test io-31.25 {Tcl_Write lf, ^Z in middle, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3662,7 +3659,7 @@ test io-31.25 {Tcl_Write lf, ^Z in middle, Tcl_Gets auto} { set l } {abc def 0 {} 1} test io-31.26 {Tcl_Write lf, ^Z in middle, Tcl_Gets lf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3680,7 +3677,7 @@ test io-31.26 {Tcl_Write lf, ^Z in middle, Tcl_Gets lf} { set l } {abc def 0 {} 1} test io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3698,7 +3695,7 @@ test io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} { set l } {abc def 0 {} 1} test io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3716,7 +3713,7 @@ test io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} { set l } {abc def 0 {} 1} test io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3734,7 +3731,7 @@ test io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} { set l } {abc def 0 {} 1} test io-31.30 {Tcl_Write crlf, ^Z in middle, Tcl_Gets crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar {} set s [format "abc\ndef\n%cqrs\ntuv" 26] @@ -3752,7 +3749,7 @@ test io-31.30 {Tcl_Write crlf, ^Z in middle, Tcl_Gets crlf} { set l } {abc def 0 {} 1} test io-31.31 {Tcl_Write crlf on block boundary, Tcl_Gets crlf} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf @@ -3771,7 +3768,7 @@ test io-31.31 {Tcl_Write crlf on block boundary, Tcl_Gets crlf} { string length $c } [expr 700*15+1] test io-31.32 {Tcl_Write crlf on block boundary, Tcl_Gets auto} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf @@ -3872,7 +3869,7 @@ test io-32.9 {Tcl_Read, read to end of file} { set x } ok test io-32.10 {Tcl_Read from a pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {puts [gets stdin]} close $f1 @@ -3884,7 +3881,7 @@ test io-32.10 {Tcl_Read from a pipe} {stdio openpipe} { set x } "hello\n" test io-32.11 {Tcl_Read from a pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {puts [gets stdin]} puts $f1 {puts [gets stdin]} @@ -3903,7 +3900,7 @@ test io-32.11 {Tcl_Read from a pipe} {stdio openpipe} { } {hello }} test io-32.12 {Tcl_Read, -nonewline} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] puts $f1 hello puts $f1 bye @@ -3915,7 +3912,7 @@ test io-32.12 {Tcl_Read, -nonewline} { } {hello bye} test io-32.13 {Tcl_Read, -nonewline} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] puts $f1 hello puts $f1 bye @@ -3927,7 +3924,7 @@ test io-32.13 {Tcl_Read, -nonewline} { } {9 {hello bye}} test io-32.14 {Tcl_Read, reading in small chunks} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" @@ -3940,7 +3937,7 @@ test io-32.14 {Tcl_Read, reading in small chunks} { and this one }} test io-32.15 {Tcl_Read, asking for more input than available} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" @@ -3953,7 +3950,7 @@ test io-32.15 {Tcl_Read, asking for more input than available} { and this one } test io-32.16 {Tcl_Read, read to end of file with -nonewline} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" @@ -3968,7 +3965,7 @@ and this one} # Test Tcl_Gets. test io-33.1 {Tcl_Gets, reading what was written} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set y "first line" puts $f1 $y @@ -3994,7 +3991,7 @@ test io-33.2 {Tcl_Gets into variable} { set z } ok test io-33.3 {Tcl_Gets from pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {puts [gets stdin]} close $f1 @@ -4010,7 +4007,7 @@ test io-33.3 {Tcl_Gets from pipe} {stdio openpipe} { set z } ok test io-33.4 {Tcl_Gets with long line} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -4030,7 +4027,7 @@ test io-33.5 {Tcl_Gets with long line} { list $x $y } {260 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} test io-33.6 {Tcl_Gets and end of file} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "Test1\nTest2" close $f @@ -4107,7 +4104,7 @@ test io-34.1 {Tcl_Seek to current position at start of file} { set c } 0 test io-34.2 {Tcl_Seek to offset from start} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4120,7 +4117,7 @@ test io-34.2 {Tcl_Seek to offset from start} { set c } 10 test io-34.3 {Tcl_Seek to end of file} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4133,7 +4130,7 @@ test io-34.3 {Tcl_Seek to end of file} { set c } 54 test io-34.4 {Tcl_Seek to offset from end of file} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4146,7 +4143,7 @@ test io-34.4 {Tcl_Seek to offset from end of file} { set c } 44 test io-34.5 {Tcl_Seek to offset from current position} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4160,7 +4157,7 @@ test io-34.5 {Tcl_Seek to offset from current position} { set c } 20 test io-34.6 {Tcl_Seek to offset from end of file} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4175,7 +4172,7 @@ test io-34.6 {Tcl_Seek to offset from end of file} { } {44 {rstuvwxyz }} test io-34.7 {Tcl_Seek to offset from end of file, then to current position} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4198,7 +4195,7 @@ test io-34.8 {Tcl_Seek on pipes: not supported} {stdio openpipe} { string tolower $x } {1 {error during seek on "": invalid argument}} test io-34.9 {Tcl_Seek, testing buffered input flushing} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] fconfigure $f -eofchar {} puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -4266,14 +4263,14 @@ test io-34.12 {Tcl_Seek testing combination of write, seek back and read} { 123 xyzzy} zzy} test io-34.13 {Tcl_Tell at start of file} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set p [tell $f1] close $f1 set p } 0 test io-34.14 {Tcl_Tell after seek to end of file} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4286,7 +4283,7 @@ test io-34.14 {Tcl_Tell after seek to end of file} { set c1 } 54 test io-34.15 {Tcl_Tell combined with seeking} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} puts $f1 "abcdefghijklmnopqrstuvwxyz" @@ -4316,7 +4313,7 @@ test io-34.17 {Tcl_Tell on pipe: always -1} {stdio openpipe} { set c } -1 test io-34.18 {Tcl_Tell combined with seeking and reading} { - removeFile test2 + file delete $path(test2) set f [open $path(test2) w] fconfigure $f -translation lf -eofchar {} puts -nonewline $f "line1\nline2\nline3\nline4\nline5\n" @@ -4362,7 +4359,7 @@ test io-34.20 {Tcl_Tell combined with writing} { set l } {29 39 40 447} test io-34.21 {Tcl_Seek and Tcl_Tell on large files} {largefileSupport} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] fconfigure $f -encoding binary set l "" @@ -4387,7 +4384,7 @@ test io-34.21 {Tcl_Seek and Tcl_Tell on large files} {largefileSupport} { # Test Tcl_Eof test io-35.1 {Tcl_Eof} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f hello puts $f hello @@ -4406,7 +4403,7 @@ test io-35.1 {Tcl_Eof} { set x } {0 0 0 0 1 1} test io-35.2 {Tcl_Eof with pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {gets stdin} puts $f1 {puts hello} @@ -4424,7 +4421,7 @@ test io-35.2 {Tcl_Eof with pipe} {stdio openpipe} { set x } {0 0 0 1} test io-35.3 {Tcl_Eof with pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {gets stdin} puts $f1 {puts hello} @@ -4446,7 +4443,7 @@ test io-35.3 {Tcl_Eof with pipe} {stdio openpipe} { set x } {0 0 0 1 1 1} test io-35.4 {Tcl_Eof, eof detection on nonblocking file} {nonBlockFiles} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -4458,7 +4455,7 @@ test io-35.4 {Tcl_Eof, eof detection on nonblocking file} {nonBlockFiles} { set l } {{} 1} test io-35.5 {Tcl_Eof, eof detection on nonblocking pipe} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f [open $path(pipe) w] puts $f { exit @@ -4472,7 +4469,7 @@ test io-35.5 {Tcl_Eof, eof detection on nonblocking pipe} {stdio openpipe} { set l } {{} 1} test io-35.6 {Tcl_Eof, eof char, lf write, auto read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar \x1a puts $f abc\ndef @@ -4486,7 +4483,7 @@ test io-35.6 {Tcl_Eof, eof char, lf write, auto read} { list $s $l $e } {9 8 1} test io-35.7 {Tcl_Eof, eof char, lf write, lf read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar \x1a puts $f abc\ndef @@ -4500,7 +4497,7 @@ test io-35.7 {Tcl_Eof, eof char, lf write, lf read} { list $s $l $e } {9 8 1} test io-35.8 {Tcl_Eof, eof char, cr write, auto read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar \x1a puts $f abc\ndef @@ -4514,7 +4511,7 @@ test io-35.8 {Tcl_Eof, eof char, cr write, auto read} { list $s $l $e } {9 8 1} test io-35.9 {Tcl_Eof, eof char, cr write, cr read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar \x1a puts $f abc\ndef @@ -4528,7 +4525,7 @@ test io-35.9 {Tcl_Eof, eof char, cr write, cr read} { list $s $l $e } {9 8 1} test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar \x1a puts $f abc\ndef @@ -4542,7 +4539,7 @@ test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} { list $s $l $e } {11 8 1} test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar \x1a puts $f abc\ndef @@ -4556,7 +4553,7 @@ test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} { list $s $l $e } {11 8 1} test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set i [format abc\ndef\n%cqrs\nuvw 26] @@ -4571,7 +4568,7 @@ test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} { list $c $l $e } {17 8 1} test io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar {} set i [format abc\ndef\n%cqrs\nuvw 26] @@ -4586,7 +4583,7 @@ test io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} { list $c $l $e } {17 8 1} test io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar {} set i [format abc\ndef\n%cqrs\nuvw 26] @@ -4601,7 +4598,7 @@ test io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} { list $c $l $e } {17 8 1} test io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar {} set i [format abc\ndef\n%cqrs\nuvw 26] @@ -4616,7 +4613,7 @@ test io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} { list $c $l $e } {17 8 1} test io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar {} set i [format abc\ndef\n%cqrs\nuvw 26] @@ -4631,7 +4628,7 @@ test io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} { list $c $l $e } {21 8 1} test io-35.17 {Tcl_Eof, eof char in middle, crlf write, crlf read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar {} set i [format abc\ndef\n%cqrs\nuvw 26] @@ -4682,7 +4679,7 @@ test io-36.2 {Tcl_InputBlocked on blocking pipe} {stdio openpipe} { set x } {hello_from_pipe 0 {} 0 1} test io-36.3 {Tcl_InputBlocked vs files, short read} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f @@ -4704,7 +4701,7 @@ test io-36.4 {Tcl_InputBlocked vs files, event driven read} {fileevent} { lappend l [read $f 3] if {[eof $f]} {lappend l eof; close $f; set x done} } - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f @@ -4717,7 +4714,7 @@ test io-36.4 {Tcl_InputBlocked vs files, event driven read} {fileevent} { } {abc def ghi jkl mno {p } eof} test io-36.5 {Tcl_InputBlocked vs files, short read, nonblocking} {nonBlockFiles} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f @@ -4740,7 +4737,7 @@ test io-36.6 {Tcl_InputBlocked vs files, event driven read} {nonBlockFiles filee lappend l [read $f 3] if {[eof $f]} {lappend l eof; close $f; set x done} } - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f @@ -4822,7 +4819,7 @@ test io-38.3 {Tcl_SetChannelBufferSize, changing buffersize between reads} { # Test Tcl_SetChannelOption, Tcl_GetChannelOption test io-39.1 {Tcl_GetChannelOption} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set x [fconfigure $f1 -blocking] close $f1 @@ -4832,14 +4829,14 @@ test io-39.1 {Tcl_GetChannelOption} { # Test 17.2 was removed. # test io-39.2 {Tcl_GetChannelOption} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set x [fconfigure $f1 -buffering] close $f1 set x } full test io-39.3 {Tcl_GetChannelOption} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -buffering line set x [fconfigure $f1 -buffering] @@ -4847,7 +4844,7 @@ test io-39.3 {Tcl_GetChannelOption} { set x } line test io-39.4 {Tcl_GetChannelOption, Tcl_SetChannelOption} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set l "" lappend l [fconfigure $f1 -buffering] @@ -4863,7 +4860,7 @@ test io-39.4 {Tcl_GetChannelOption, Tcl_SetChannelOption} { set l } {full line none line full} test io-39.5 {Tcl_GetChannelOption, invariance} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set l "" lappend l [fconfigure $f1 -buffering] @@ -4873,7 +4870,7 @@ test io-39.5 {Tcl_GetChannelOption, invariance} { set l } {full {1 {bad value for -buffering: must be one of full, line, or none}} full} test io-39.6 {Tcl_SetChannelOption, multiple options} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -buffering line puts $f1 hello @@ -4883,7 +4880,7 @@ test io-39.6 {Tcl_SetChannelOption, multiple options} { set x } 10 test io-39.7 {Tcl_SetChannelOption, buffering, translation} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 hello @@ -4897,7 +4894,7 @@ test io-39.7 {Tcl_SetChannelOption, buffering, translation} { set x } {0 21} test io-39.8 {Tcl_SetChannelOption, different buffering options} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set l "" fconfigure $f1 -translation lf -buffering none -eofchar {} @@ -4917,7 +4914,7 @@ test io-39.8 {Tcl_SetChannelOption, different buffering options} { set l } {5 10 10 10 20 20} test io-39.9 {Tcl_SetChannelOption, blocking mode} {nonBlockFiles} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] close $f1 set f1 [open $path(test1) r] @@ -4933,7 +4930,7 @@ test io-39.9 {Tcl_SetChannelOption, blocking mode} {nonBlockFiles} { set x } {1 0 {} {} 0 1} test io-39.10 {Tcl_SetChannelOption, blocking mode} {stdio openpipe} { - removeFile pipe + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { gets stdin @@ -4969,7 +4966,7 @@ test io-39.10 {Tcl_SetChannelOption, blocking mode} {stdio openpipe} { set x } {0 {} 1 {} 1 {} 1 1 hi 0 0 {} 1} test io-39.11 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -buffersize -10 set x [fconfigure $f -buffersize] @@ -4977,7 +4974,7 @@ test io-39.11 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} { set x } 4096 test io-39.12 {Tcl_SetChannelOption, Tcl_GetChannelOption buffer size} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -buffersize 10000000 set x [fconfigure $f -buffersize] @@ -4985,7 +4982,7 @@ test io-39.12 {Tcl_SetChannelOption, Tcl_GetChannelOption buffer size} { set x } 4096 test io-39.13 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -buffersize 40000 set x [fconfigure $f -buffersize] @@ -4993,7 +4990,7 @@ test io-39.13 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} { set x } 40000 test io-39.14 {Tcl_SetChannelOption: -encoding, binary & utf-8} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -encoding {} puts -nonewline $f \xe7\x89\xa6 @@ -5005,7 +5002,7 @@ test io-39.14 {Tcl_SetChannelOption: -encoding, binary & utf-8} { set x } \u7266 test io-39.15 {Tcl_SetChannelOption: -encoding, binary & utf-8} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -encoding binary puts -nonewline $f \xe7\x89\xa6 @@ -5017,7 +5014,7 @@ test io-39.15 {Tcl_SetChannelOption: -encoding, binary & utf-8} { set x } \u7266 test io-39.16 {Tcl_SetChannelOption: -encoding, errors} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] set result [list [catch {fconfigure $f -encoding foobar} msg] $msg] close $f @@ -5100,7 +5097,7 @@ test io-39.21 {Tcl_SetChannelOption, setting read mode independently} \ } {auto crlf} test io-39.22 {Tcl_SetChannelOption, invariance} {unixOnly} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w+] set l "" lappend l [fconfigure $f1 -eofchar] @@ -5113,7 +5110,7 @@ test io-39.22 {Tcl_SetChannelOption, invariance} {unixOnly} { } {{{} {}} {O G} {D D}} test io-39.22a {Tcl_SetChannelOption, invariance} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w+] set l [list] fconfigure $f1 -eofchar {ON GO} @@ -5145,7 +5142,7 @@ test io-39.24 {Tcl_SetChannelOption, server socket is not readable or } {{{}} auto} test io-40.1 {POSIX open access modes: RDWR} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f @@ -5160,7 +5157,7 @@ test io-40.1 {POSIX open access modes: RDWR} { set x } {zzy abzzy} test io-40.2 {POSIX open access modes: CREAT} {unixOnly} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) {WRONLY CREAT} 0600] file stat $path(test3) stats set x [format "0%o" [expr $stats(mode)&0777]] @@ -5178,14 +5175,14 @@ catch {testConstraint umask2 [expr {[exec umask] == 2}]} test io-40.3 {POSIX open access modes: CREAT} {unixOnly umask2} { # This test only works if your umask is 2, like ouster's. - removeFile test3 + file delete $path(test3) set f [open $path(test3) {WRONLY CREAT}] close $f file stat test3 stats format "0%o" [expr $stats(mode)&0777] } 0664 test io-40.4 {POSIX open access modes: CREAT} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] fconfigure $f -eofchar {} puts $f xyzzy @@ -5200,7 +5197,7 @@ test io-40.4 {POSIX open access modes: CREAT} { set x } abzzy test io-40.5 {POSIX open access modes: APPEND} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] fconfigure $f -translation lf -eofchar {} puts $f xyzzy @@ -5221,14 +5218,14 @@ test io-40.5 {POSIX open access modes: APPEND} { set x } {{new line} abc} test io-40.6 {POSIX open access modes: EXCL} -match regexp -body { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f open $path(test3) {WRONLY CREAT EXCL} } -returnCodes error -result {(?i)couldn't open ".*test3": file (already )?exists} test io-40.7 {POSIX open access modes: EXCL} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) {WRONLY CREAT EXCL}] fconfigure $f -eofchar {} puts $f "A test line" @@ -5236,7 +5233,7 @@ test io-40.7 {POSIX open access modes: EXCL} { viewFile test3 } {A test line} test io-40.8 {POSIX open access modes: TRUNC} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f @@ -5249,7 +5246,7 @@ test io-40.8 {POSIX open access modes: TRUNC} { set x } abc test io-40.9 {POSIX open access modes: NONBLOCK} {nonPortable macOrUnix} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) {WRONLY NONBLOCK CREAT}] puts $f "NONBLOCK test" close $f @@ -5271,11 +5268,11 @@ test io-40.10 {POSIX open access modes: RDONLY} { [format "channel \"%s\" wasn't opened for writing" $f]] } 0 test io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { - removeFile test3 + file delete $path(test3) open $path(test3) RDONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { - removeFile test3 + file delete $path(test3) open $path(test3) WRONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.13 {POSIX open access modes: WRONLY} { @@ -5291,7 +5288,7 @@ test io-40.13 {POSIX open access modes: WRONLY} { [list 1 "channel \"$f\" wasn't opened for reading" abzzy] } 0 test io-40.14 {POSIX open access modes: RDWR} -match regexp -body { - removeFile test3 + file delete $path(test3) open $path(test3) RDWR } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.15 {POSIX open access modes: RDWR} { @@ -5304,14 +5301,13 @@ test io-40.15 {POSIX open access modes: RDWR} { lappend x [viewFile test3] } {zzy abzzy} if {![file exists ~/_test_] && [file writable ~]} { - test io-40.16 {tilde substitution in open} { - set f [open ~/_test_ w] - puts $f "Some text" - close $f - set x [file exists [file join $env(HOME) _test_]] - removeFile [file join $env(HOME) _test_] - set x - } 1 + test io-40.16 {tilde substitution in open} -setup { + makeFile {Some text} _test_ ~ + } -body { + file exists [file join $env(HOME) _test_] + } -cleanup { + removeFile _test_ ~ + } -result 1 } test io-40.17 {tilde substitution in open} { set home $env(HOME) @@ -5769,7 +5765,7 @@ test io-48.3 {testing readability conditions} {stdio unixOnly nonBlockFiles open list $x $l } {done {0 1 0 1 0 1 0 1 0 1 0 1 0 0}} test io-48.4 {lf write, testing readability, ^Z termination, auto read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%c" 26] @@ -5797,7 +5793,7 @@ test io-48.4 {lf write, testing readability, ^Z termination, auto read mode} {fi list $c $l } {3 {abc def {}}} test io-48.5 {lf write, testing readability, ^Z in middle, auto read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%cfoo\nbar\n" 26] @@ -5825,7 +5821,7 @@ test io-48.5 {lf write, testing readability, ^Z in middle, auto read mode} {file list $c $l } {3 {abc def {}}} test io-48.6 {cr write, testing readability, ^Z termination, auto read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%c" 26] @@ -5853,7 +5849,7 @@ test io-48.6 {cr write, testing readability, ^Z termination, auto read mode} {fi list $c $l } {3 {abc def {}}} test io-48.7 {cr write, testing readability, ^Z in middle, auto read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%cfoo\nbar\n" 26] @@ -5881,7 +5877,7 @@ test io-48.7 {cr write, testing readability, ^Z in middle, auto read mode} {file list $c $l } {3 {abc def {}}} test io-48.8 {crlf write, testing readability, ^Z termination, auto read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%c" 26] @@ -5909,7 +5905,7 @@ test io-48.8 {crlf write, testing readability, ^Z termination, auto read mode} { list $c $l } {3 {abc def {}}} test io-48.9 {crlf write, testing readability, ^Z in middle, auto read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%cfoo\nbar\n" 26] @@ -5937,7 +5933,7 @@ test io-48.9 {crlf write, testing readability, ^Z in middle, auto read mode} {fi list $c $l } {3 {abc def {}}} test io-48.10 {lf write, testing readability, ^Z in middle, lf read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%cfoo\nbar\n" 26] @@ -5965,7 +5961,7 @@ test io-48.10 {lf write, testing readability, ^Z in middle, lf read mode} {filee list $c $l } {3 {abc def {}}} test io-48.11 {lf write, testing readability, ^Z termination, lf read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%c" 26] @@ -5993,7 +5989,7 @@ test io-48.11 {lf write, testing readability, ^Z termination, lf read mode} {fil list $c $l } {3 {abc def {}}} test io-48.12 {cr write, testing readability, ^Z in middle, cr read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%cfoo\nbar\n" 26] @@ -6021,7 +6017,7 @@ test io-48.12 {cr write, testing readability, ^Z in middle, cr read mode} {filee list $c $l } {3 {abc def {}}} test io-48.13 {cr write, testing readability, ^Z termination, cr read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%c" 26] @@ -6049,7 +6045,7 @@ test io-48.13 {cr write, testing readability, ^Z termination, cr read mode} {fil list $c $l } {3 {abc def {}}} test io-48.14 {crlf write, testing readability, ^Z in middle, crlf read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%cfoo\nbar\n" 26] @@ -6077,7 +6073,7 @@ test io-48.14 {crlf write, testing readability, ^Z in middle, crlf read mode} {f list $c $l } {3 {abc def {}}} test io-48.15 {crlf write, testing readability, ^Z termi, crlf read mode} {fileevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%c" 26] @@ -6106,7 +6102,7 @@ test io-48.15 {crlf write, testing readability, ^Z termi, crlf read mode} {filee } {3 {abc def {}}} test io-49.1 {testing crlf reading, leftover cr disgorgment} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" @@ -6135,7 +6131,7 @@ test io-49.1 {testing crlf reading, leftover cr disgorgment} { } "7 a 1 [list \r] 2 b 3 [list \r] 4 c 5 { } 7 0 {} 1" test io-49.2 {testing crlf reading, leftover cr disgorgment} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" @@ -6158,7 +6154,7 @@ test io-49.2 {testing crlf reading, leftover cr disgorgment} { set l } "7 [list a\r] 2 [list b\r] 4 [list c\n] 7 0 {} 7 1" test io-49.3 {testing crlf reading, leftover cr disgorgment} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" @@ -6179,7 +6175,7 @@ test io-49.3 {testing crlf reading, leftover cr disgorgment} { set l } "7 [list a\rb] 3 [list \rc\n] 7 0 {} 7 1" test io-49.4 {testing crlf reading, leftover cr disgorgment} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" @@ -6200,7 +6196,7 @@ test io-49.4 {testing crlf reading, leftover cr disgorgment} { set l } "7 [list a\rb] 3 [list \rc] 7 0 {} 7 1" test io-49.5 {testing crlf reading, leftover cr disgorgment} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" @@ -6220,7 +6216,7 @@ test io-49.5 {testing crlf reading, leftover cr disgorgment} { testConstraint testchannelevent [llength [info commands testchannelevent]] test io-50.1 {testing handler deletion} {testchannelevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6236,7 +6232,7 @@ test io-50.1 {testing handler deletion} {testchannelevent} { set z } called test io-50.2 {testing handler deletion with multiple handlers} {testchannelevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6254,7 +6250,7 @@ test io-50.2 {testing handler deletion with multiple handlers} {testchannelevent [list [list called delhandler $f 0] [list called delhandler $f 1]] } 0 test io-50.3 {testing handler deletion with multiple handlers} {testchannelevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6280,7 +6276,7 @@ test io-50.3 {testing handler deletion with multiple handlers} {testchannelevent [list delhandler $f 0 deleted myself]] } 0 test io-50.4 {testing handler deletion vs reentrant calls} {testchannelevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6305,7 +6301,7 @@ test io-50.4 {testing handler deletion vs reentrant calls} {testchannelevent} { {{delrecursive calling recursive} {delrecursive deleting recursive}} } 0 test io-50.5 {testing handler deletion vs reentrant calls} {testchannelevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6339,7 +6335,7 @@ test io-50.5 {testing handler deletion vs reentrant calls} {testchannelevent} { {del deleted myself} {del after update}] } 0 test io-50.6 {testing handler deletion vs reentrant calls} {testchannelevent} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6422,7 +6418,7 @@ test io-51.1 {Test old socket deletion on Macintosh} {socket} { } {sock1 sock2 sock3 sock4} test io-52.1 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fcopy $f1 $f2 -command { # } @@ -6432,7 +6428,7 @@ test io-52.1 {TclCopyChannel} {fcopy} { string compare $msg "channel \"$f1\" is busy" } {0} test io-52.2 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] set f3 [open $thisScript] @@ -6444,7 +6440,7 @@ test io-52.2 {TclCopyChannel} {fcopy} { string compare $msg "channel \"$f2\" is busy" } {0} test io-52.3 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6461,7 +6457,7 @@ test io-52.3 {TclCopyChannel} {fcopy} { set result } {0 0 ok} test io-52.4 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6473,7 +6469,7 @@ test io-52.4 {TclCopyChannel} {fcopy} { lappend result [file size $path(test1)] } {0 0 40} test io-52.5 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6490,7 +6486,7 @@ test io-52.5 {TclCopyChannel} {fcopy} { set result } {0 0 ok} test io-52.6 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6507,7 +6503,7 @@ test io-52.6 {TclCopyChannel} {fcopy} { set result } {0 0 ok} test io-52.7 {TclCopyChannel} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6524,8 +6520,8 @@ test io-52.7 {TclCopyChannel} {fcopy} { set result } {0 0 ok} test io-52.8 {TclCopyChannel} {stdio openpipe fcopy} { - removeFile test1 - removeFile pipe + file delete $path(test1) + file delete $path(pipe) set f1 [open $path(pipe) w] fconfigure $f1 -translation lf puts $f1 " @@ -6629,7 +6625,7 @@ test io-52.11 {TclCopyChannel & encodings} {fcopy} { } 3 test io-53.1 {CopyData} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6641,7 +6637,7 @@ test io-53.1 {CopyData} {fcopy} { lappend result [file size $path(test1)] } {0 0 0} test io-53.2 {CopyData} {fcopy} { - removeFile test1 + file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 @@ -6660,8 +6656,8 @@ test io-53.2 {CopyData} {fcopy} { set result } {0 0 ok} test io-53.3 {CopyData: background read underflow} {stdio unixOnly openpipe fcopy} { - removeFile test1 - removeFile pipe + file delete $path(test1) + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 [format { puts ready @@ -6695,8 +6691,8 @@ test io-53.4 {CopyData: background write overflow} {stdio unixOnly openpipe file for {set x 0} {$x < 12} {incr x} { append big $big } - removeFile test1 - removeFile pipe + file delete $path(test1) + file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { puts ready @@ -6758,8 +6754,8 @@ test io-53.5 {CopyData: error during fcopy} {socket fcopy} { } 1 test io-53.6 {CopyData: error during fcopy} {stdio openpipe fcopy} { variable fcopyTestDone - removeFile pipe - removeFile test1 + file delete $path(pipe) + file delete $path(test1) catch {unset fcopyTestDone} set f1 [open $path(pipe) w] puts $f1 "exit 1" @@ -6795,8 +6791,7 @@ proc doFcopy {in out {bytes 0} {error {}}} { test io-53.7 {CopyData: Flooding fcopy from pipe} {stdio openpipe fcopy} { variable fcopyTestDone - removeFile pipe - removeFile test1 + file delete $path(pipe) catch {unset fcopyTestDone} set fcopyTestCount 0 set f1 [open $path(pipe) w] @@ -7108,7 +7103,7 @@ test io-60.1 {writing illegal utf sequences} {openpipe fileevent} { # cleanup foreach file [list fooBar longfile script output test1 pipe my_script foo \ - bar test2 test3 cat stdout] { + bar test2 test3 cat stdout kyrillic.txt utf8-fcopy.txt utf8-rp.txt] { removeFile $file } cleanupTests diff --git a/tests/ioCmd.test b/tests/ioCmd.test index b10738b..63f9895 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.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: ioCmd.test,v 1.18 2003/10/07 14:58:29 dgp Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.19 2003/10/07 21:45:39 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -21,9 +21,6 @@ if {[lsearch [namespace children] ::tcltest] == -1} { testConstraint fcopy [llength [info commands fcopy]] -removeFile test1 -removeFile pipe - test iocmd-1.1 {puts command} { list [catch {puts} msg] $msg } {1 {wrong # args: should be "puts ?-nonewline? ?channelId? string"}} @@ -124,7 +121,7 @@ test iocmd-4.7 {read command} { list [catch {read -nonewline stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test iocmd-4.8 {read command with incorrect combination of arguments} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" @@ -200,7 +197,7 @@ test iocmd-8.3 {fconfigure command} { list [catch {fconfigure a b} msg] $msg } {1 {can not find channel named "a"}} test iocmd-8.4 {fconfigure command} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] set x [list [catch {fconfigure $f1 froboz} msg] $msg] close $f1 @@ -213,7 +210,7 @@ test iocmd-8.6 {fconfigure command} { list [catch {fconfigure stdin -translation froboz} msg] $msg } {1 {bad value for -translation: must be one of auto, binary, cr, lf, crlf, or platform}} test iocmd-8.7 {fconfigure command} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -eofchar {} -encoding unicode set x [fconfigure $f1] @@ -221,7 +218,7 @@ test iocmd-8.7 {fconfigure command} { set x } {-blocking 1 -buffering full -buffersize 4096 -encoding unicode -eofchar {} -translation lf} test iocmd-8.8 {fconfigure command} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -buffering line -buffersize 3030 \ -eofchar {} -encoding unicode @@ -232,7 +229,7 @@ test iocmd-8.8 {fconfigure command} { set x } {line {-blocking 1 -buffering line -buffersize 3030 -encoding unicode -eofchar {} -translation lf}} test iocmd-8.9 {fconfigure command} { - removeFile test1 + file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation binary -buffering none -buffersize 4040 \ -eofchar {} -encoding binary @@ -367,7 +364,7 @@ test iocmd-10.5 {fblocked command} { set path(test4) [makeFile {} test4] set path(test5) [makeFile {} test5] -removeFile test5 +file delete $path(test5) test iocmd-11.1 {I/O to command pipelines} {unixOrPc unixExecs} { set f [open $path(test4) w] close $f @@ -381,7 +378,7 @@ test iocmd-11.3 {I/O to command pipelines} {unixOrPc unixExecs} { } {1 {can't read output from command: standard output was redirected} NONE} test iocmd-12.1 {POSIX open access modes: RDONLY} { - removeFile test1 + file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" @@ -393,18 +390,18 @@ test iocmd-12.1 {POSIX open access modes: RDONLY} { "{Two lines: this one} 1 [list [format "channel \"%s\" wasn't opened for writing" $f]]" } 0 test iocmd-12.2 {POSIX open access modes: RDONLY} -match regexp -body { - removeFile test3 + file delete $path(test3) open $path(test3) RDONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test iocmd-12.3 {POSIX open access modes: WRONLY} -match regexp -body { - removeFile test3 + file delete $path(test3) open $path(test3) WRONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} # # Test 13.4 relies on assigning the same channel name twice. # test iocmd-12.4 {POSIX open access modes: WRONLY} {unixOnly} { - removeFile test3 + file delete $path(test3) set f [open $path(test3) w] fconfigure $f -eofchar {} puts $f xyzzy @@ -423,7 +420,7 @@ test iocmd-12.4 {POSIX open access modes: WRONLY} {unixOnly} { string compare $x $y } 0 test iocmd-12.5 {POSIX open access modes: RDWR} -match regexp -body { - removeFile test3 + file delete $path(test3) open $path(test3) RDWR } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test iocmd-12.6 {POSIX open access modes: errors} { @@ -439,6 +436,7 @@ test iocmd-12.7 {POSIX open access modes: errors} { test iocmd-12.8 {POSIX open access modes: errors} { list [catch {open $path(test3) {TRUNC CREAT}} msg] $msg } {1 {access mode must include either RDONLY, WRONLY, or RDWR}} +close [open $path(test3) w] test iocmd-13.1 {errors in open command} { list [catch {open} msg] $msg @@ -548,12 +546,12 @@ close $wfile # cleanup foreach file [list test1 test2 test3 test4] { - catch {::tcltest::removeFile $file} + removeFile $file } # delay long enough for background processes to finish after 500 -foreach file [list test5 pipe output] { - catch {::tcltest::removeFile $file} +foreach file [list test5] { + removeFile $file } -::tcltest::cleanupTests +cleanupTests return diff --git a/tests/main.test b/tests/main.test index 605bab8..30de5ed 100644 --- a/tests/main.test +++ b/tests/main.test @@ -1,6 +1,6 @@ # This file contains a collection of tests for generic/tclMain.c. # -# RCS: @(#) $Id: main.test,v 1.14 2003/09/05 21:52:12 dgp Exp $ +# RCS: @(#) $Id: main.test,v 1.15 2003/10/07 21:45:39 dgp Exp $ if {[catch {package require tcltest 2.0.2}]} { puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required." @@ -145,7 +145,7 @@ namespace eval ::tcl::test::main { stdio } -setup { set script [makeFile {} script] - removeFile script + file delete $script set f [open $script w] fconfigure $f -encoding utf-8 puts $f {puts [list $argv0 $argv $tcl_interactive]} @@ -166,7 +166,7 @@ namespace eval ::tcl::test::main { stdio } -setup { set script [makeFile {} script] - removeFile script + file delete $script set f [open $script w] fconfigure $f -encoding utf-8 puts $f {puts [list $argv0 $argv $tcl_interactive]} @@ -187,7 +187,7 @@ namespace eval ::tcl::test::main { stdio } -setup { set script [makeFile {} script] - removeFile script + file delete $script set f [open $script w] fconfigure $f -encoding utf-8 puts $f {puts [list $argv0 $argv $tcl_interactive]} diff --git a/tests/socket.test b/tests/socket.test index 1f95749..3719b0f 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: socket.test,v 1.26 2002/07/10 11:56:45 dgp Exp $ +# RCS: @(#) $Id: socket.test,v 1.27 2003/10/07 21:45:39 dgp Exp $ # Running socket tests with a remote server: # ------------------------------------------ @@ -246,7 +246,7 @@ test socket-1.12 {arg parsing for socket command} {socket} { set path(script) [makeFile {} script] test socket-2.1 {tcp connection} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timed_out"] @@ -284,7 +284,7 @@ if [info exists port] { set port [expr 2048 + [pid]%1024] } test socket-2.2 {tcp connection with client port specified} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timeout"] @@ -320,7 +320,7 @@ test socket-2.2 {tcp connection with client port specified} {socket stdio} { set x } [list ready "hello $port"] test socket-2.3 {tcp connection with client interface specified} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 2000 "set x done"] @@ -351,7 +351,7 @@ test socket-2.3 {tcp connection with client interface specified} {socket stdio} set x } {ready {hello 127.0.0.1}} test socket-2.4 {tcp connection with server interface specified} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 2000 "set x done"] @@ -384,7 +384,7 @@ test socket-2.4 {tcp connection with server interface specified} {socket stdio} set x } {ready hello} test socket-2.5 {tcp connection with redundant server port} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timeout"] @@ -427,7 +427,7 @@ test socket-2.6 {tcp connection} {socket} { set status } ok test socket-2.7 {echo server, one line} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timeout"] @@ -467,8 +467,9 @@ test socket-2.7 {echo server, one line} {socket stdio} { close $f list $x $y } {{hello abcdefghijklmnop} done} -test socket-2.8 {echo server, loop 50 times, single connection} {socket stdio} { - makeFile { +removeFile script +test socket-2.8 {echo server, loop 50 times, single connection} -constraints {socket stdio} -setup { + set path(script) [makeFile { set f [socket -server accept 0] proc accept {s a p} { fileevent $s readable [list echo $s] @@ -494,7 +495,8 @@ test socket-2.8 {echo server, loop 50 times, single connection} {socket stdio} { after cancel $timer close $f puts "done $i" - } script + } script] +} -body { set f [open "|[list [interpreter] $path(script)]" r] gets $f gets $f listen @@ -510,10 +512,13 @@ test socket-2.8 {echo server, loop 50 times, single connection} {socket stdio} { catch {set x [gets $f]} close $f set x -} {done 50} +} -cleanup { + removeFile script +} -result {done 50} +set path(script) [makeFile {} script] test socket-2.9 {socket conflict} {socket stdio} { set s [socket -server accept 0] - removeFile script + file delete $path(script) set f [open $path(script) w] puts -nonewline $f "socket -server accept [lindex [fconfigure $s -sockname] 2]" close $f @@ -579,7 +584,7 @@ test socket-2.11 {detecting new data} {socket} { test socket-3.1 {socket conflict} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set f [socket -server accept 0] @@ -599,7 +604,7 @@ test socket-3.1 {socket conflict} {socket stdio} { set x } {1 {couldn't open socket: address already in use}} test socket-3.2 {server with several clients} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set t1 [after 30000 "set x timed_out"] @@ -659,7 +664,7 @@ test socket-3.2 {server with several clients} {socket stdio} { } {ready done} test socket-4.1 {server with several clients} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set port [gets stdin] @@ -759,7 +764,7 @@ test socket-5.3 {byte order problems, socket numbers, htons} \ } {couldn't open socket: not owner} test socket-6.1 {accept callback error} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { gets stdin port @@ -784,7 +789,7 @@ test socket-6.1 {accept callback error} {socket stdio} { } {{divide by zero}} test socket-7.1 {testing socket specific options} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set ss [socket -server accept 0] @@ -812,7 +817,7 @@ test socket-7.1 {testing socket specific options} {socket stdio} { lappend l [llength $p] } {0 0 3} test socket-7.2 {testing socket specific options} {socket stdio} { - removeFile script + file delete $path(script) set f [open $path(script) w] puts $f { set ss [socket -server accept 2821] @@ -1391,8 +1396,8 @@ set path(script1) [makeFile {} script1] set path(script2) [makeFile {} script2] test socket-12.1 {testing inheritance of server sockets} {socket stdio exec} { - removeFile script1 - removeFile script2 + file delete $path(script1) + file delete $path(script2) # Script1 is just a 10 second delay. If the server socket # is inherited, it will be held open for 10 seconds @@ -1441,14 +1446,12 @@ test socket-12.1 {testing inheritance of server sockets} {socket stdio exec} { set x {server socket was inherited} } - removeFile script1 - removeFile script2 close $p set x } {server socket was not inherited} test socket-12.2 {testing inheritance of client sockets} {socket stdio exec} { - removeFile script1 - removeFile script2 + file delete $path(script1) + file delete $path(script2) # Script1 is just a 20 second delay. If the server socket # is inherited, it will be held open for 10 seconds @@ -1528,14 +1531,12 @@ test socket-12.2 {testing inheritance of client sockets} {socket stdio exec} { if {!$failed} { vwait failed } - removeFile script1 - removeFile script2 close $p set x } {client socket was not inherited} test socket-12.3 {testing inheritance of accepted sockets} {socket stdio exec} { - removeFile script1 - removeFile script2 + file delete $path(script1) + file delete $path(script2) set f [open $path(script1) w] puts $f { @@ -1605,8 +1606,6 @@ test socket-12.3 {testing inheritance of accepted sockets} {socket stdio exec} { vwait x - removeFile script1 - removeFile script2 close $p set x } {accepted socket was not inherited} @@ -1614,7 +1613,7 @@ test socket-12.3 {testing inheritance of accepted sockets} {socket stdio exec} { test socket-13.1 {Testing use of shared socket between two threads} \ {socket testthread} { - removeFile script + file delete $path(script1) threadReap makeFile { @@ -1668,6 +1667,9 @@ test socket-13.1 {Testing use of shared socket between two threads} \ } {hello 1} +removeFile script1 +removeFile script2 + # cleanup if {[string match sock* $commandSocket] == 1} { puts $commandSocket exit diff --git a/tests/source.test b/tests/source.test index 413c658..828b9da 100644 --- a/tests/source.test +++ b/tests/source.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: source.test,v 1.9 2003/09/05 21:52:12 dgp Exp $ +# RCS: @(#) $Id: source.test,v 1.10 2003/10/07 21:45:39 dgp Exp $ if {[catch {package require tcltest 2.0.2}]} { puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required." @@ -306,7 +306,7 @@ test source-6.2 {source skips everything after Ctrl-Z: Bug 2040} -setup { test source-7.1 {source -encoding test} -setup { set sourcefile [makeFile {} source.file] - removeFile source.file + file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-8 puts $f "set symbol(square-root) \u221A; set x correct" @@ -326,7 +326,7 @@ test source-7.2 {source -encoding test} -setup { # file that contains the byte \x1A, although not the character \u001A in # the indicated encoding. set sourcefile [makeFile {} source.file] - removeFile source.file + file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding unicode puts $f "set symbol(square-root) \u221A; set x correct" @@ -354,7 +354,7 @@ test source-7.4 {source -encoding: syntax} -setup { test source-7.5 {source -encoding: correct operation} -setup { set sourcefile [makeFile {} source.file] - removeFile source.file + file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-8 puts $f "proc \u20ac {} {return foo}" @@ -369,7 +369,7 @@ test source-7.5 {source -encoding: correct operation} -setup { test source-7.6 {source -encoding: mismatch encoding error} -setup { set sourcefile [makeFile {} source.file] - removeFile source.file + file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-8 puts $f "proc \u20ac {} {return foo}" -- cgit v0.12