diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-18 13:22:21 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-18 13:22:21 (GMT) |
commit | 48db2fee44128a4882b9868bfa3f52f6788fd2fb (patch) | |
tree | 7fad667a9796cda9acab97a4a9d7dd2ff5dcb02d | |
parent | 20cc8e0bc110e2370ccc8de16637734127d5fcba (diff) | |
parent | 92e97aec374dfefc0a80edf3fcd4cde7c5cda86c (diff) | |
download | tcl-48db2fee44128a4882b9868bfa3f52f6788fd2fb.zip tcl-48db2fee44128a4882b9868bfa3f52f6788fd2fb.tar.gz tcl-48db2fee44128a4882b9868bfa3f52f6788fd2fb.tar.bz2 |
Merge 8.7
-rw-r--r-- | tests/chanio.test | 12 | ||||
-rw-r--r-- | tests/io.test | 18 |
2 files changed, 22 insertions, 8 deletions
diff --git a/tests/chanio.test b/tests/chanio.test index e668655..cbb94a6 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -269,7 +269,7 @@ test chan-io-3.5 {WriteChars: saved != 0} -body { } -cleanup { chan close $f } -errorCode {POSIX EILSEQ {illegal byte sequence}} -match glob -result {error writing "*": illegal byte sequence} -test chan-io-3.6 {WriteChars: (stageRead + dstWrote == 0)} { +test chan-io-3.6 {WriteChars: (stageRead + dstWrote == 0)} -body { # One incomplete UTF-8 character at end of staging buffer. Backup in src # to the beginning of that UTF-8 character and try again. # @@ -284,7 +284,9 @@ test chan-io-3.6 {WriteChars: (stageRead + dstWrote == 0)} { set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] -} [list "12345678901234\x82\x60" "12345678901234\x82\x60\x82\x61"] +} -cleanup { + catch {chan close $f} +} -result [list "12345678901234\x82\x60" "12345678901234\x82\x60\x82\x61"] test chan-io-3.7 {WriteChars: (bufPtr->nextAdded > bufPtr->length)} -body { # When translating UTF-8 to external, the produced bytes went past end of # the channel buffer. This is done on purpose - we then truncate the bytes @@ -298,7 +300,7 @@ test chan-io-3.7 {WriteChars: (bufPtr->nextAdded > bufPtr->length)} -body { } -cleanup { chan close $f } -errorCode {POSIX EILSEQ {illegal byte sequence}} -match glob -result {error writing "*": illegal byte sequence} -test chan-io-3.8 {WriteChars: reset sawLF after each buffer} { +test chan-io-3.8 {WriteChars: reset sawLF after each buffer} -body { set f [open $path(test1) w] chan configure $f -encoding ascii -buffering line -translation lf \ -buffersize 16 @@ -306,7 +308,9 @@ test chan-io-3.8 {WriteChars: reset sawLF after each buffer} { set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] -} [list "abcdefg\nhijklmno" "abcdefg\nhijklmnopqrstuvwxyz"] +} -cleanup { + catch {chan close $f} +} -result [list "abcdefg\nhijklmno" "abcdefg\nhijklmnopqrstuvwxyz"] test chan-io-4.1 {TranslateOutputEOL: lf} { # search for \n diff --git a/tests/io.test b/tests/io.test index 9b7a34a..83381c8 100644 --- a/tests/io.test +++ b/tests/io.test @@ -277,6 +277,8 @@ test io-3.4 {WriteChars: loop over stage buffer} -body { set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] +} -cleanup { + catch {close $f} } -errorCode {POSIX EILSEQ {illegal byte sequence}} -match glob -result {error writing "*": illegal byte sequence} test io-3.5 {WriteChars: saved != 0} -body { # Bytes produced by UtfToExternal from end of last channel buffer @@ -289,6 +291,8 @@ test io-3.5 {WriteChars: saved != 0} -body { set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] +} -cleanup { + catch {close $f} } -errorCode {POSIX EILSEQ {illegal byte sequence}} -match glob -result {error writing "*": illegal byte sequence} test io-3.6 {WriteChars: (stageRead + dstWrote == 0)} { # One incomplete UTF-8 character at end of staging buffer. Backup @@ -320,6 +324,8 @@ test io-3.7 {WriteChars: (bufPtr->nextAdded > bufPtr->length)} -body { set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] +} -cleanup { + catch {close $f} } -errorCode {POSIX EILSEQ {illegal byte sequence}} -match glob -result {error writing "*": illegal byte sequence} test io-3.8 {WriteChars: reset sawLF after each buffer} { set f [open $path(test1) w] @@ -1532,7 +1538,7 @@ test io-12.8 {ReadChars: multibyte chars split} { close $f scan [string index $in end] %c } 160 -test io-12.9 {ReadChars: multibyte chars split} knownBug { +test io-12.9 {ReadChars: multibyte chars split} -constraints knownBug -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 @@ -1542,8 +1548,10 @@ test io-12.9 {ReadChars: multibyte chars split} knownBug { set in [read $f] close $f scan [string index $in end] %c -} 194 -test io-12.10 {ReadChars: multibyte chars split} knownBug { +} -cleanup { + catch {close $f} +} -result 194 +test io-12.10 {ReadChars: multibyte chars split} -constraints knownBug -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 @@ -1553,7 +1561,9 @@ test io-12.10 {ReadChars: multibyte chars split} knownBug { set in [read $f] close $f scan [string index $in end] %c -} 194 +} -cleanup { + catch {close $f} +} -result 194 test io-13.1 {TranslateInputEOL: cr mode} {} { set f [open $path(test1) w] |