diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-22 23:29:06 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-22 23:29:06 (GMT) |
| commit | 0f0efcd41e1a7c770f86f71c459aea383c29ed98 (patch) | |
| tree | 67233d88c779a6838884bdeca2777c2157436146 | |
| parent | ac1f3f7a090fa8c8eab3353880d6a8673ce70364 (diff) | |
| download | tcl-0f0efcd41e1a7c770f86f71c459aea383c29ed98.zip tcl-0f0efcd41e1a7c770f86f71c459aea383c29ed98.tar.gz tcl-0f0efcd41e1a7c770f86f71c459aea383c29ed98.tar.bz2 | |
Since -eofchar {} is the default already, no need to specify this over and over again in testcases
| -rw-r--r-- | tests/chan.test | 2 | ||||
| -rw-r--r-- | tests/chanio.test | 134 | ||||
| -rw-r--r-- | tests/cmdAH.test | 2 | ||||
| -rw-r--r-- | tests/io.test | 162 | ||||
| -rw-r--r-- | tests/ioCmd.test | 26 | ||||
| -rw-r--r-- | tests/macOSXFCmd.test | 4 |
6 files changed, 165 insertions, 165 deletions
diff --git a/tests/chan.test b/tests/chan.test index 04fd17e..ea85e45 100644 --- a/tests/chan.test +++ b/tests/chan.test @@ -64,7 +64,7 @@ test chan-4.5 {chan command: check valid inValue, invalid outValue} -body { } -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} test chan-4.6 {chan command: check no inValue, valid outValue} -body { chan configure stdout -eofchar [list {} \x27] -} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} -cleanup {chan configure stdout -eofchar {}} +} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} test chan-5.1 {chan command: copy subcommand} -body { chan copy foo diff --git a/tests/chanio.test b/tests/chanio.test index ce166aa..b51c616 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -69,7 +69,7 @@ namespace eval ::tcl::test::io { set path(longfile) [makeFile {} longfile] set f [open $path(longfile) w] - chan configure $f -eofchar {} -translation lf + chan configure $f -translation lf for { set i 0 } { $i < 100 } { incr i} { chan puts $f "#123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \#123456789abcdef01 @@ -1953,7 +1953,7 @@ test chan-io-25.1 {Tcl_GetChannelHandle, input} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f "1234567890\n098765432" chan close $f set f [open $path(test1) r] @@ -2005,7 +2005,7 @@ test chan-io-27.2 {FlushChannel, some output buffered} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f hello lappend l [file size $path(test1)] chan flush $f @@ -2018,7 +2018,7 @@ test chan-io-27.3 {FlushChannel, implicit flush on chan close} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f hello lappend l [file size $path(test1)] chan close $f @@ -2029,7 +2029,7 @@ test chan-io-27.4 {FlushChannel, implicit flush when buffer fills} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan configure $f -buffersize 60 lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { @@ -2046,7 +2046,7 @@ test chan-io-27.5 {FlushChannel, implicit flush when buffer fills and on chan cl set l "" } -constraints {unixOrWin} -body { set f [open $path(test1) w] - chan configure $f -translation lf -buffersize 60 -eofchar {} + chan configure $f -translation lf -buffersize 60 lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { chan puts $f hello @@ -2064,7 +2064,7 @@ test chan-io-27.6 {FlushChannel, async flushing, async chan close} -setup { set f [open $path(pipe) w] chan puts $f "set f \[[list open $path(output) w]]" chan puts $f { - chan configure $f -translation lf -buffering none -eofchar {} + chan configure $f -translation lf -buffering none while {![chan eof stdin]} { after 20 chan puts -nonewline $f [chan read stdin 1024] @@ -2136,8 +2136,8 @@ test chan-io-28.3 {Chan CloseChannel, not called before output queue is empty} - # Need to not have eof char appended on chan close, because the other # side of the pipe already chan closed, so that writing would cause an # error "invalid file". - chan configure stdout -eofchar {} - chan configure stderr -eofchar {} + chan configure stdout + chan configure stderr set f [open $path(output) w] chan configure $f -translation lf -buffering none for {set x 0} {$x < 20} {incr x} { @@ -2154,7 +2154,7 @@ test chan-io-28.3 {Chan CloseChannel, not called before output queue is empty} - set f [open $path(output) w] chan close $f set f [openpipe r+ $path(pipe)] - chan configure $f -blocking off -eofchar {} + chan configure $f -blocking off chan puts -nonewline $f $x chan close $f set counter 0 @@ -2271,7 +2271,7 @@ test chan-io-29.2 {Tcl_WriteChars, empty string} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -eofchar {} + chan configure $f chan puts -nonewline $f "" chan close $f file size $path(test1) @@ -2280,7 +2280,7 @@ test chan-io-29.3 {Tcl_WriteChars, nonempty string} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -eofchar {} + chan configure $f chan puts -nonewline $f hello chan close $f file size $path(test1) @@ -2290,7 +2290,7 @@ test chan-io-29.4 {Tcl_WriteChars, buffering in full buffering mode} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] - chan configure $f -translation lf -buffering full -eofchar {} + chan configure $f -translation lf -buffering full chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] @@ -2305,7 +2305,7 @@ test chan-io-29.5 {Tcl_WriteChars, buffering in line buffering mode} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] - chan configure $f -translation lf -buffering line -eofchar {} + chan configure $f -translation lf -buffering line chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] @@ -2320,7 +2320,7 @@ test chan-io-29.6 {Tcl_WriteChars, buffering in no buffering mode} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] - chan configure $f -translation lf -buffering none -eofchar {} + chan configure $f -translation lf -buffering none chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] @@ -2335,7 +2335,7 @@ test chan-io-29.7 {Tcl_Flush, full buffering} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] - chan configure $f -translation lf -buffering full -eofchar {} + chan configure $f -translation lf -buffering full chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] @@ -2376,7 +2376,7 @@ test chan-io-29.10 {Tcl_WriteChars, looping and buffering} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { chan puts $f1 [chan gets $f2] @@ -2389,7 +2389,7 @@ test chan-io-29.11 {Tcl_WriteChars, no newline, implicit flush} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -eofchar {} + chan configure $f1 set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { chan puts -nonewline $f1 [chan gets $f2] @@ -2523,7 +2523,7 @@ test chan-io-29.19 {Explicit and implicit flushes} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf set x "" chan puts $f1 hello chan puts $f1 hello @@ -2541,7 +2541,7 @@ test chan-io-29.20 {Implicit flush when buffer is full} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf set line "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" for {set x 0} {$x < 100} {incr x} { chan puts $f1 $line @@ -2682,7 +2682,7 @@ test chan-io-29.28 {Tcl_WriteChars, lf mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan flush $f file size $path(test1) @@ -2693,7 +2693,7 @@ test chan-io-29.29 {Tcl_WriteChars, cr mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f file size $path(test1) @@ -2702,7 +2702,7 @@ test chan-io-29.30 {Tcl_WriteChars, crlf mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f file size $path(test1) @@ -3180,11 +3180,11 @@ test chan-io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cghi\nqrs" 26] chan close $f set f [open $path(test1) r] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] @@ -3202,11 +3202,11 @@ test chan-io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cghi\nqrs" 26] chan close $f set f [open $path(test1) r] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr set x [chan gets $f] lappend l [string equal $x "abc\ndef\n\x1Aghi\nqrs\n"] lappend l [chan eof $f] @@ -3220,11 +3220,11 @@ test chan-io-30.22 {Tcl_Write, ^Z in middle ignored, Tcl_Read crlf} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cghi\nqrs" 26] chan close $f set f [open $path(test1) r] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf set x [chan gets $f] lappend l [string equal $x "abc\ndef\n\x1Aghi\nqrs\n"] lappend l [chan eof $f] @@ -3734,11 +3734,11 @@ test chan-io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] @@ -3756,11 +3756,11 @@ test chan-io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] @@ -3778,11 +3778,11 @@ test chan-io-31.24 {Tcl_Write, ^Z in middle ignored, Tcl_Gets crlf} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] @@ -3836,7 +3836,7 @@ test chan-io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] @@ -3854,7 +3854,7 @@ test chan-io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] @@ -3872,7 +3872,7 @@ test chan-io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] @@ -3890,7 +3890,7 @@ test chan-io-31.30 {Tcl_Write crlf, ^Z in middle, Tcl_Gets crlf} -setup { set l "" } -body { set f [open $path(test1) w] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] @@ -4221,7 +4221,7 @@ test chan-io-33.7 {Tcl_Gets and bad variable} -setup { } -result {can't set "x(0)": variable isn't array} test chan-io-33.8 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 100} {incr y} {chan puts $f $x} @@ -4234,7 +4234,7 @@ test chan-io-33.8 {Tcl_Gets, exercising double buffering} { } 100 test chan-io-33.9 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 200} {incr y} {chan puts $f $x} @@ -4247,7 +4247,7 @@ test chan-io-33.9 {Tcl_Gets, exercising double buffering} { } 200 test chan-io-33.10 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 300} {incr y} {chan puts $f $x} @@ -4272,7 +4272,7 @@ test chan-io-34.2 {Tcl_Seek to offset from start} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4286,7 +4286,7 @@ test chan-io-34.3 {Tcl_Seek to end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4300,7 +4300,7 @@ test chan-io-34.4 {Tcl_Seek to offset from end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4314,7 +4314,7 @@ test chan-io-34.5 {Tcl_Seek to offset from current position} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4329,7 +4329,7 @@ test chan-io-34.6 {Tcl_Seek to offset from end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4344,7 +4344,7 @@ test chan-io-34.7 {Tcl_Seek to offset from end of file, then to current position file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4368,7 +4368,7 @@ test chan-io-34.9 {Tcl_Seek, testing buffered input flushing} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] - chan configure $f -eofchar {} + chan configure $f chan puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan close $f set f [open $path(test3) RDWR] @@ -4416,11 +4416,11 @@ test chan-io-34.11 {Tcl_Seek testing flushing of buffered output} { } "zzy xyzzy" test chan-io-34.12 {Tcl_Seek testing combination of write, seek back and read} { set f [open $path(test3) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f xyz\n123 chan close $f set f [open $path(test3) a+] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f xyzzy chan flush $f set x [chan tell $f] @@ -4443,7 +4443,7 @@ test chan-io-34.14 {Tcl_Tell after seek to end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4457,7 +4457,7 @@ test chan-io-34.15 {Tcl_Tell combined with seeking} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -eofchar {} + chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 @@ -4488,7 +4488,7 @@ test chan-io-34.18 {Tcl_Tell combined with seeking and reading} -setup { file delete $path(test2) } -body { set f [open $path(test2) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts -nonewline $f "line1\nline2\nline3\nline4\nline5\n" chan close $f set f [open $path(test2)] @@ -4507,7 +4507,7 @@ test chan-io-34.18 {Tcl_Tell combined with seeking and reading} -setup { } -result {0 3 2 12 30} test chan-io-34.19 {Tcl_Tell combined with opening in append mode} -body { set f [open $path(test3) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f "abcdefghijklmnopqrstuvwxyz" chan puts $f "abcdefghijklmnopqrstuvwxyz" chan close $f @@ -4734,7 +4734,7 @@ test chan-io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] @@ -4748,7 +4748,7 @@ test chan-io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] @@ -4762,7 +4762,7 @@ test chan-io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] @@ -4776,7 +4776,7 @@ test chan-io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation cr -eofchar {} + chan configure $f -translation cr chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] @@ -4790,7 +4790,7 @@ test chan-io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] @@ -4804,7 +4804,7 @@ test chan-io-35.17 {Tcl_Eof, eof char in middle, crlf write, crlf read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] - chan configure $f -translation crlf -eofchar {} + chan configure $f -translation crlf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] @@ -5078,7 +5078,7 @@ test chan-io-39.8 {Tcl_SetChannelOption, different buffering options} -setup { set l "" } -body { set f1 [open $path(test1) w] - chan configure $f1 -translation lf -buffering none -eofchar {} + chan configure $f1 -translation lf -buffering none chan puts -nonewline $f1 hello lappend l [file size $path(test1)] chan puts -nonewline $f1 hello @@ -5375,11 +5375,11 @@ test chan-io-40.4 {POSIX open access modes: CREAT} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] - chan configure $f -eofchar {} + chan configure $f chan puts $f xyzzy chan close $f set f [open $path(test3) {WRONLY CREAT}] - chan configure $f -eofchar {} + chan configure $f chan puts -nonewline $f "ab" chan close $f set f [open $path(test3) r] @@ -5392,7 +5392,7 @@ test chan-io-40.5 {POSIX open access modes: APPEND} -setup { set x "" } -body { set f [open $path(test3) w] - chan configure $f -translation lf -eofchar {} + chan configure $f -translation lf chan puts $f xyzzy chan close $f set f [open $path(test3) {WRONLY APPEND}] @@ -5421,7 +5421,7 @@ test chan-io-40.7 {POSIX open access modes: EXCL} -setup { file delete $path(test3) } -body { set f [open $path(test3) {WRONLY CREAT EXCL}] - chan configure $f -eofchar {} + chan configure $f chan puts $f "A test line" chan close $f viewFile test3 @@ -5472,7 +5472,7 @@ test chan-io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { test chan-io-40.13 {POSIX open access modes: WRONLY} -body { makeFile xyzzy test3 set f [open $path(test3) WRONLY] - chan configure $f -eofchar {} + chan configure $f chan puts -nonewline $f "ab" chan seek $f 0 current set x [list [catch {chan gets $f} msg] $msg] diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 834fd68..53a82e6 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -1800,7 +1800,7 @@ test cmdAH-27.1 {Tcl_FileObjCmd: size} -returnCodes error -body { test cmdAH-27.2 {Tcl_FileObjCmd: size} { set oldsize [file size $gorpfile] set f [open $gorpfile a] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f "More text" close $f expr {[file size $gorpfile] - $oldsize} diff --git a/tests/io.test b/tests/io.test index d550352..2c813c0 100644 --- a/tests/io.test +++ b/tests/io.test @@ -67,7 +67,7 @@ testConstraint makeFileInHome [expr {![file exists ~/_test_] && [file writable ~ set path(longfile) [makeFile {} longfile] set f [open $path(longfile) w] -fconfigure $f -eofchar {} -translation lf +fconfigure $f -translation lf for { set i 0 } { $i < 100 } { incr i} { puts $f "#123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \#123456789abcdef01 @@ -2229,7 +2229,7 @@ test io-24.1 {Tcl_GetChannelType} {testchannel} { test io-25.1 {Tcl_GetChannelHandle, input} {testchannel} { set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f "1234567890\n098765432" close $f set f [open $path(test1) r] @@ -2278,7 +2278,7 @@ test io-27.1 {FlushChannel, no output buffered} { test io-27.2 {FlushChannel, some output buffered} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set l "" puts $f hello lappend l [file size $path(test1)] @@ -2291,7 +2291,7 @@ test io-27.2 {FlushChannel, some output buffered} { test io-27.3 {FlushChannel, implicit flush on close} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set l "" puts $f hello lappend l [file size $path(test1)] @@ -2302,7 +2302,7 @@ test io-27.3 {FlushChannel, implicit flush on close} { test io-27.4 {FlushChannel, implicit flush when buffer fills} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf fconfigure $f -buffersize 60 set l "" lappend l [file size $path(test1)] @@ -2319,7 +2319,7 @@ test io-27.5 {FlushChannel, implicit flush when buffer fills and on close} \ {unixOrWin} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -buffersize 60 -eofchar {} + fconfigure $f -translation lf -buffersize 60 set l "" lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { @@ -2341,7 +2341,7 @@ test io-27.6 {FlushChannel, async flushing, async close} \ set f [open $path(pipe) w] puts $f "set f \[[list open $path(output) w]]" puts $f { - fconfigure $f -translation lf -buffering none -eofchar {} + fconfigure $f -translation lf -buffering none while {![eof stdin]} { after 20 puts -nonewline $f [read stdin 1024] @@ -2412,8 +2412,8 @@ test io-28.3 {CloseChannel, not called before output queue is empty} \ # side of the pipe already closed, so that writing would cause an # error "invalid file". - fconfigure stdout -eofchar {} - fconfigure stderr -eofchar {} + fconfigure stdout + fconfigure stderr set f [open $path(output) w] fconfigure $f -translation lf -buffering none @@ -2431,7 +2431,7 @@ test io-28.3 {CloseChannel, not called before output queue is empty} \ set f [open $path(output) w] close $f set f [open "|[list [interpreter] pipe]" r+] - fconfigure $f -blocking off -eofchar {} + fconfigure $f -blocking off puts -nonewline $f $x close $f @@ -2564,7 +2564,7 @@ test io-29.1 {Tcl_WriteChars, channel not writable} { test io-29.2 {Tcl_WriteChars, empty string} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -eofchar {} + fconfigure $f puts -nonewline $f "" close $f file size $path(test1) @@ -2572,7 +2572,7 @@ test io-29.2 {Tcl_WriteChars, empty string} { test io-29.3 {Tcl_WriteChars, nonempty string} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -eofchar {} + fconfigure $f puts -nonewline $f hello close $f file size $path(test1) @@ -2580,7 +2580,7 @@ test io-29.3 {Tcl_WriteChars, nonempty string} { test io-29.4 {Tcl_WriteChars, buffering in full buffering mode} {testchannel} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -buffering full -eofchar {} + fconfigure $f -translation lf -buffering full puts $f hello set l "" lappend l [testchannel outputbuffered $f] @@ -2594,7 +2594,7 @@ test io-29.4 {Tcl_WriteChars, buffering in full buffering mode} {testchannel} { test io-29.5 {Tcl_WriteChars, buffering in line buffering mode} {testchannel} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -buffering line -eofchar {} + fconfigure $f -translation lf -buffering line puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] @@ -2608,7 +2608,7 @@ test io-29.5 {Tcl_WriteChars, buffering in line buffering mode} {testchannel} { test io-29.6 {Tcl_WriteChars, buffering in no buffering mode} {testchannel} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -buffering none -eofchar {} + fconfigure $f -translation lf -buffering none puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] @@ -2622,7 +2622,7 @@ test io-29.6 {Tcl_WriteChars, buffering in no buffering mode} {testchannel} { test io-29.7 {Tcl_Flush, full buffering} {testchannel} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -buffering full -eofchar {} + fconfigure $f -translation lf -buffering full puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] @@ -2662,7 +2662,7 @@ test io-29.9 {Tcl_Flush, channel not writable} { test io-29.10 {Tcl_WriteChars, looping and buffering} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { puts $f1 [gets $f2] @@ -2674,7 +2674,7 @@ test io-29.10 {Tcl_WriteChars, looping and buffering} { test io-29.11 {Tcl_WriteChars, no newline, implicit flush} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -eofchar {} + fconfigure $f1 set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { puts -nonewline $f1 [gets $f2] @@ -2800,7 +2800,7 @@ test io-29.18 {Tcl_WriteChars and Tcl_Flush intermixed} { test io-29.19 {Explicit and implicit flushes} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf set x "" puts $f1 hello puts $f1 hello @@ -2818,7 +2818,7 @@ test io-29.19 {Explicit and implicit flushes} { test io-29.20 {Implicit flush when buffer is full} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf set line "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" for {set x 0} {$x < 100} {incr x} { puts $f1 $line @@ -2956,7 +2956,7 @@ test io-29.27 {Tcl_Flush on closed pipeline} stdio { test io-29.28 {Tcl_WriteChars, lf mode} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f hello\nthere\nand\nhere flush $f set s [file size $path(test1)] @@ -2966,7 +2966,7 @@ test io-29.28 {Tcl_WriteChars, lf mode} { test io-29.29 {Tcl_WriteChars, cr mode} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f file size $path(test1) @@ -2974,7 +2974,7 @@ test io-29.29 {Tcl_WriteChars, cr mode} { test io-29.30 {Tcl_WriteChars, crlf mode} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f file size $path(test1) @@ -3548,12 +3548,12 @@ test io-30.19 {Tcl_Write, ^Z no newline in middle, Tcl_Read auto} { test io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set l "" lappend l [gets $f] lappend l [gets $f] @@ -3570,12 +3570,12 @@ test io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} { test io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set l "" set x [gets $f] lappend l [string compare $x "abc\ndef\n\x1Aghi\nqrs\n"] @@ -3588,12 +3588,12 @@ test io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} { test io-30.22 {Tcl_Write, ^Z in middle ignored, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set l "" set x [gets $f] lappend l [string compare $x "abc\ndef\n\x1Aghi\nqrs\n"] @@ -4084,12 +4084,12 @@ test io-31.21 {Tcl_Write, no newline ^Z in middle, Tcl_Gets auto, eofChar} { test io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set l "" lappend l [gets $f] lappend l [gets $f] @@ -4106,12 +4106,12 @@ test io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} { test io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set l "" lappend l [gets $f] lappend l [gets $f] @@ -4128,12 +4128,12 @@ test io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} { test io-31.24 {Tcl_Write, ^Z in middle ignored, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set l "" lappend l [gets $f] lappend l [gets $f] @@ -4186,7 +4186,7 @@ test io-31.26 {Tcl_Write lf, ^Z in middle, Tcl_Gets lf} { test io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f @@ -4204,7 +4204,7 @@ test io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} { test io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f @@ -4222,7 +4222,7 @@ test io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} { test io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f @@ -4240,7 +4240,7 @@ test io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} { test io-31.30 {Tcl_Write crlf, ^Z in middle, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f @@ -4609,7 +4609,7 @@ test io-33.7 {Tcl_Gets and bad variable} { } {1 {can't set "x(0)": variable isn't array}} test io-33.8 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 100} {incr y} {puts $f $x} @@ -4622,7 +4622,7 @@ test io-33.8 {Tcl_Gets, exercising double buffering} { } 100 test io-33.9 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 200} {incr y} {puts $f $x} @@ -4635,7 +4635,7 @@ test io-33.9 {Tcl_Gets, exercising double buffering} { } 200 test io-33.10 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 300} {incr y} {puts $f $x} @@ -4763,7 +4763,7 @@ test io-34.1 {Tcl_Seek to current position at start of file} { test io-34.2 {Tcl_Seek to offset from start} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4776,7 +4776,7 @@ test io-34.2 {Tcl_Seek to offset from start} { test io-34.3 {Tcl_Seek to end of file} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4789,7 +4789,7 @@ test io-34.3 {Tcl_Seek to end of file} { test io-34.4 {Tcl_Seek to offset from end of file} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4802,7 +4802,7 @@ test io-34.4 {Tcl_Seek to offset from end of file} { test io-34.5 {Tcl_Seek to offset from current position} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4816,7 +4816,7 @@ test io-34.5 {Tcl_Seek to offset from current position} { test io-34.6 {Tcl_Seek to offset from end of file} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4831,7 +4831,7 @@ test io-34.6 {Tcl_Seek to offset from end of file} { test io-34.7 {Tcl_Seek to offset from end of file, then to current position} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4854,7 +4854,7 @@ test io-34.8 {Tcl_Seek on pipes: not supported} stdio { test io-34.9 {Tcl_Seek, testing buffered input flushing} { file delete $path(test3) set f [open $path(test3) w] - fconfigure $f -eofchar {} + fconfigure $f puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" close $f set f [open $path(test3) RDWR] @@ -4902,11 +4902,11 @@ test io-34.11 {Tcl_Seek testing flushing of buffered output} { } "zzy xyzzy" test io-34.12 {Tcl_Seek testing combination of write, seek back and read} { set f [open $path(test3) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f xyz\n123 close $f set f [open $path(test3) a+] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f xyzzy flush $f set x [tell $f] @@ -4927,7 +4927,7 @@ test io-34.13 {Tcl_Tell at start of file} { test io-34.14 {Tcl_Tell after seek to end of file} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4940,7 +4940,7 @@ test io-34.14 {Tcl_Tell after seek to end of file} { test io-34.15 {Tcl_Tell combined with seeking} { file delete $path(test1) set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} + fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 @@ -4970,7 +4970,7 @@ test io-34.17 {Tcl_Tell on pipe: always -1} stdio { test io-34.18 {Tcl_Tell combined with seeking and reading} { file delete $path(test2) set f [open $path(test2) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts -nonewline $f "line1\nline2\nline3\nline4\nline5\n" close $f set f [open $path(test2)] @@ -4989,7 +4989,7 @@ test io-34.18 {Tcl_Tell combined with seeking and reading} { } {0 3 2 12 30} test io-34.19 {Tcl_Tell combined with opening in append mode} { set f [open $path(test3) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f "abcdefghijklmnopqrstuvwxyz" puts $f "abcdefghijklmnopqrstuvwxyz" close $f @@ -5210,7 +5210,7 @@ test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} { test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5225,7 +5225,7 @@ test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} { test io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5240,7 +5240,7 @@ test io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} { test io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5255,7 +5255,7 @@ test io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} { test io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5270,7 +5270,7 @@ test io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} { test io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5285,7 +5285,7 @@ test io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} { test io-35.17 {Tcl_Eof, eof char in middle, crlf write, crlf read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation crlf -eofchar {} + fconfigure $f -translation crlf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5356,7 +5356,7 @@ test io-35.18c {Tcl_Eof, eof char, cr write, crlf read} -body { test io-35.19 {Tcl_Eof, eof char in middle, cr write, crlf read} -body { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f @@ -5371,7 +5371,7 @@ test io-35.19 {Tcl_Eof, eof char in middle, cr write, crlf read} -body { test io-35.20 {Tcl_Eof, eof char in middle, cr write, crlf read} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -translation cr -eofchar {} + fconfigure $f -translation cr set i [format \n%cqrsuvw 26] puts $f $i close $f @@ -5407,9 +5407,9 @@ test io-36.1 {Tcl_InputBlocked on nonblocking pipe} stdio { } {{} 1 hello 0 {} 1} test io-36.1.1 {Tcl_InputBlocked on nonblocking binary pipe} stdio { set f1 [open "|[list [interpreter]]" r+] - chan configure $f1 -encoding binary -translation lf -eofchar {} + chan configure $f1 -encoding binary -translation lf puts $f1 { - chan configure stdout -encoding binary -translation lf -eofchar {} + chan configure stdout -encoding binary -translation lf puts hello_from_pipe } flush $f1 @@ -5657,7 +5657,7 @@ test io-39.8 {Tcl_SetChannelOption, different buffering options} { file delete $path(test1) set f1 [open $path(test1) w] set l "" - fconfigure $f1 -translation lf -buffering none -eofchar {} + fconfigure $f1 -translation lf -buffering none puts -nonewline $f1 hello lappend l [file size $path(test1)] puts -nonewline $f1 hello @@ -5941,11 +5941,11 @@ test io-40.3 {POSIX open access modes: CREAT} {unix umask notWsl} { test io-40.4 {POSIX open access modes: CREAT} { file delete $path(test3) set f [open $path(test3) w] - fconfigure $f -eofchar {} + fconfigure $f puts $f xyzzy close $f set f [open $path(test3) {WRONLY CREAT}] - fconfigure $f -eofchar {} + fconfigure $f puts -nonewline $f "ab" close $f set f [open $path(test3) r] @@ -5956,7 +5956,7 @@ test io-40.4 {POSIX open access modes: CREAT} { test io-40.5 {POSIX open access modes: APPEND} { file delete $path(test3) set f [open $path(test3) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f xyzzy close $f set f [open $path(test3) {WRONLY APPEND}] @@ -5984,7 +5984,7 @@ test io-40.6 {POSIX open access modes: EXCL} -match regexp -body { test io-40.7 {POSIX open access modes: EXCL} { file delete $path(test3) set f [open $path(test3) {WRONLY CREAT EXCL}] - fconfigure $f -eofchar {} + fconfigure $f puts $f "A test line" close $f viewFile test3 @@ -6035,7 +6035,7 @@ test io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { test io-40.13 {POSIX open access modes: WRONLY} { makeFile xyzzy test3 set f [open $path(test3) WRONLY] - fconfigure $f -eofchar {} + fconfigure $f puts -nonewline $f "ab" seek $f 0 current set x [list [catch {gets $f} msg] $msg] @@ -9426,7 +9426,7 @@ test io-75.6 {incomplete utf-8 encoding, blocking gets is not ignored (-profile puts -nonewline $f A\x81 flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} \ + fconfigure $f -encoding utf-8 -buffering none \ -translation lf -profile strict } -body { gets $f @@ -9444,7 +9444,7 @@ test io-75.6.1 {invalid utf-8 encoding, blocking gets is not ignored (-profile s puts -nonewline $f A\xC3B flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} \ + fconfigure $f -encoding utf-8 -buffering none \ -translation lf -profile strict } -body { gets $f @@ -9462,7 +9462,7 @@ test io-75.6.2 {invalid utf-8 encoding, blocking gets is not ignored (-profile s puts -nonewline $f A\xC3B flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} \ + fconfigure $f -encoding utf-8 -buffering none \ -translation lf -profile strict } -body { set l {} @@ -9484,7 +9484,7 @@ test io-75.6.3 {invalid utf-8 encoding, non blocking gets is not ignored (-profi puts -nonewline $f A\xC3B flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} \ + fconfigure $f -encoding utf-8 -buffering none \ -translation lf -profile strict -blocking 0 } -body { gets $f @@ -9502,7 +9502,7 @@ test io-75.6.4 {incomplete utf-8 encoding, non blocking gets is not ignored (-pr puts -nonewline $f A\x81 flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} \ + fconfigure $f -encoding utf-8 -buffering none \ -translation lf -profile strict -blocking 0 } -body { gets $f @@ -9524,7 +9524,7 @@ test io-75.7 { puts -nonewline $f A\x81 flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} -translation lf \ + fconfigure $f -encoding utf-8 -buffering none -translation lf \ -profile strict } -body { list [catch {read $f} msg data] $msg [dict get $data -data] @@ -9660,7 +9660,7 @@ test io-75.11 {shiftjis encoding error read results in error (strict profile)} - puts -nonewline $f A\x81\xFFA flush $f seek $f 0 - fconfigure $f -encoding shiftjis -blocking 0 -eofchar {} -translation lf \ + fconfigure $f -encoding shiftjis -blocking 0 -translation lf \ -profile strict } -body { set d [read $f] @@ -9684,7 +9684,7 @@ test io-75.12 { puts -nonewline $f A\x81 flush $f seek $f 0 - fconfigure $f -encoding utf-8 -buffering none -eofchar {} -translation lf + fconfigure $f -encoding utf-8 -buffering none -translation lf } -body { catch {read $f} errmsg lappend res $errmsg @@ -9712,7 +9712,7 @@ test io-75.13 { puts -nonewline $f A\x81 flush $f seek $f 0 - fconfigure $f -encoding utf-8 -blocking 0 -eofchar {} -translation lf \ + fconfigure $f -encoding utf-8 -blocking 0 -translation lf \ -profile strict } -body { set d [read $f] @@ -9736,7 +9736,7 @@ test io-75.14 { puts -nonewline $chan a\nb\nc\xC0\nd\n flush $chan seek $chan 0 - fconfigure $chan -encoding utf-8 -buffering none -eofchar {} \ + fconfigure $chan -encoding utf-8 -buffering none \ -translation auto -profile strict } -body { set res [gets $chan] diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 6d5fcef..ef7403e 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -48,14 +48,14 @@ set path(test1) [makeFile {} test1] test iocmd-1.6 {puts command} { set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts -nonewline $f foobar close $f file size $path(test1) } 6 test iocmd-1.7 {puts command} { set f [open $path(test1) w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts $f foobar close $f file size $path(test1) @@ -241,7 +241,7 @@ test iocmd-8.7 {fconfigure command} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] - fconfigure $f1 -translation lf -eofchar {} -encoding utf-16 + fconfigure $f1 -translation lf -encoding utf-16 fconfigure $f1 } -cleanup { catch {close $f1} @@ -252,7 +252,7 @@ test iocmd-8.8 {fconfigure command} -setup { } -body { set f1 [open $path(test1) w] fconfigure $f1 -translation lf -buffering line -buffersize 3030 \ - -eofchar {} -encoding utf-16 -profile tcl8 + -encoding utf-16 -profile tcl8 lappend x [fconfigure $f1 -buffering] lappend x [fconfigure $f1] } -cleanup { @@ -446,17 +446,17 @@ test iocmd-12.3 {POSIX open access modes: WRONLY} -match regexp -body { test iocmd-12.4 {POSIX open access modes: WRONLY} {unix} { file delete $path(test3) set f [open $path(test3) w] - fconfigure $f -eofchar {} + fconfigure $f puts $f xyzzy close $f set f [open $path(test3) WRONLY] - fconfigure $f -eofchar {} + fconfigure $f puts -nonewline $f "ab" seek $f 0 current set x [list [catch {gets $f} msg] $msg] close $f set f [open $path(test3) r] - fconfigure $f -eofchar {} + fconfigure $f lappend x [gets $f] close $f set y [list 1 [format "channel \"%s\" wasn't opened for reading" $f] abzzy] @@ -1392,7 +1392,7 @@ test iocmd-25.1 {chan configure, cgetall, standard options} -match glob -body { close $c rename foo {} set res -} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -profile * -translation {auto *}}} +} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -profile * -translation {auto *}}} test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body { set res {} proc foo args {oninit cget cgetall; onfinal; track; return ""} @@ -1401,7 +1401,7 @@ test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body { close $c rename foo {} set res -} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -profile * -translation {auto *}}} +} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -profile * -translation {auto *}}} test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body { set res {} proc foo args { @@ -1413,7 +1413,7 @@ test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body { close $c rename foo {} set res -} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -profile * -translation {auto *} -bar foo -snarf x}} +} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -profile * -translation {auto *} -bar foo -snarf x}} test iocmd-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body { set res {} proc foo {args} { @@ -2977,7 +2977,7 @@ test iocmd.tf-25.1 {chan configure, cgetall, standard options} -match glob -body rename foo {} set res } -constraints {testchannel thread} \ - -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *}}} + -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * * -translation {auto *}}} test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body { set res {} proc foo {args} {oninit cget cgetall; onfinal; track; return ""} @@ -2990,7 +2990,7 @@ test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body { rename foo {} set res } -constraints {testchannel thread} \ - -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *}}} + -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * * -translation {auto *}}} test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body { set res {} proc foo {args} { @@ -3006,7 +3006,7 @@ test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body { rename foo {} set res } -constraints {testchannel thread} \ - -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *} -bar foo -snarf x}} + -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * * -translation {auto *} -bar foo -snarf x}} test iocmd.tf-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body { set res {} proc foo {args} { diff --git a/tests/macOSXFCmd.test b/tests/macOSXFCmd.test index 5a62a2a..b0af565 100644 --- a/tests/macOSXFCmd.test +++ b/tests/macOSXFCmd.test @@ -104,7 +104,7 @@ test macOSXFCmd-2.7 {MacOSXSetFileAttribute - rsrclength} {macosxFileAttr notRoo close [open foo.test w] catch { set f [open foo.test/..namedfork/rsrc w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts -nonewline $f "foo" close $f } @@ -121,7 +121,7 @@ test macOSXFCmd-3.1 {MacOSXCopyFileAttributes} {macosxFileAttr notRoot} { catch { file attributes foo.test -creator FOOC -type FOOT -hidden 1 set f [open foo.test/..namedfork/rsrc w] - fconfigure $f -translation lf -eofchar {} + fconfigure $f -translation lf puts -nonewline $f "foo" close $f file copy foo.test bar.test |
