summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-18 14:04:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-18 14:04:05 (GMT)
commitb19862400b0fde8a9ee9233384130eb36164597a (patch)
treee808dc1bb1f93c24c2b931b568e4774e65ec48bd
parenta5055aa3dbba90dd71e73a7a8b28726b647d94f5 (diff)
parent48db2fee44128a4882b9868bfa3f52f6788fd2fb (diff)
downloadtcl-b19862400b0fde8a9ee9233384130eb36164597a.zip
tcl-b19862400b0fde8a9ee9233384130eb36164597a.tar.gz
tcl-b19862400b0fde8a9ee9233384130eb36164597a.tar.bz2
Merge 9.0
-rw-r--r--tests/chanio.test12
-rw-r--r--tests/io.test18
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]