diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2022-09-11 08:48:25 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2022-09-11 08:48:25 (GMT) |
commit | 1c7b977c449451a107b7b06b184689cfc8d066b4 (patch) | |
tree | 5a93b34dc808044a2518bd1eac77075dfea616ea /tests | |
parent | f3e9e16aa8d60c188668f533277ca5a94919abd3 (diff) | |
parent | 1b1f3ea6b7141d2f2ef93704c60fc61a40fc597a (diff) | |
download | tcl-1c7b977c449451a107b7b06b184689cfc8d066b4.zip tcl-1c7b977c449451a107b7b06b184689cfc8d066b4.tar.gz tcl-1c7b977c449451a107b7b06b184689cfc8d066b4.tar.bz2 |
Merge 8.7. Make place for future tests with tolerant encoding. Number tests for strict encoding 75.4-75.6.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/io.test | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/tests/io.test b/tests/io.test index f65e221..8b93317 100644 --- a/tests/io.test +++ b/tests/io.test @@ -8952,53 +8952,60 @@ test io-74.1 {[104f2885bb] improper cache validity check} -setup { removeFile io-74.1 } -returnCodes error -match glob -result {can not find channel named "*"} -# Note: the following tests 75.1 to 75.3 are in preparation for TCL 9.0, where -# those should result in an error result -test io-75.1 {multibyte encoding error read results in raw bytes} -setup { - set fn [makeFile {} io-75.1] +# The tests 75.1 to 75.3 exercise tolerant channel encoding. +# They are left as a place-holder here. If TIP633 is voted, they will +# come back. +# Exercise strct channel encoding +test io-75.4 {multibyte encoding error read results in raw bytes} -setup { + set fn [makeFile {} io-75.4] set f [open $fn w+] fconfigure $f -encoding binary - # In UTF-8, a byte 0xCx starts a multibyte sequence and must be followed - # by a byte > 0x7F. This is violated to get an invalid sequence. - puts -nonewline $f "A\xC0\x40" - flush $f - seek $f 0 - fconfigure $f -encoding utf-8 -buffering none + # In UTF-8, a byte 0xCx starts a multibyte sequence and must be followed + # by a byte > 0x7F. This is violated to get an invalid sequence. + puts -nonewline $f "A\xC0\x40" + flush $f + seek $f 0 + fconfigure $f -encoding utf-8 -buffering none } -constraints knownBug -body { - read $f + read $f } -cleanup { - close $f - removeFile io-75.1 + close $f + removeFile io-75.4 } -returnCodes error -test io-75.2 {unrepresentable character write passes and is replaced by ?} -setup { - set fn [makeFile {} io-75.2] +test io-75.5 {unrepresentable character write passes and is replaced by ?} -setup { + set fn [makeFile {} io-75.5] set f [open $fn w+] fconfigure $f -encoding iso8859-1 } -constraints knownBug -body { - puts -nonewline $f "A\u2022" + puts -nonewline $f "A\u2022" +} -body { + puts -nonewline $f "A\u2022" + flush $f + seek $f 0 + read $f } -cleanup { - close $f - removeFile io-75.2 + close $f + removeFile io-75.5 } -returnCodes error # Incomplete sequence test. # This error may IMHO only be detected with the close. # But the read already returns the incomplete sequence. -test io-75.3 {incomplete multibyte encoding read is ignored} -setup { - set fn [makeFile {} io-75.3] +test io-75.6 {incomplete multibyte encoding read is ignored} -setup { + set fn [makeFile {} io-75.6] set f [open $fn w+] fconfigure $f -encoding binary - puts -nonewline $f "A\xC0" - flush $f - seek $f 0 - fconfigure $f -encoding utf-8 -buffering none + puts -nonewline $f "A\xC0" + flush $f + seek $f 0 + fconfigure $f -encoding utf-8 -buffering none } -constraints knownBug -body { - set d [read $f] - close $f - set d + set d [read $f] + close $f + set d } -cleanup { - removeFile io-75.3 + removeFile io-75.6 } -returnCodes error # ### ### ### ######### ######### ######### |