Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Revise use of "-translation binary" in testcases: Use it where usefull, don't use it any more where misleading |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | main |
Files: | files | file ages | folders |
SHA3-256: |
fafe0d36d91abf830a80a72ba5d5ab4b |
User & Date: | jan.nijtmans 2024-06-21 20:37:14 |
Context
2024-06-22
| ||
23:29 | Since -eofchar {} is the default already, no need to specify this over and over again in testcases check-in: ee2b3f8f66 user: jan.nijtmans tags: trunk, main | |
2024-06-21
| ||
20:37 | Revise use of "-translation binary" in testcases: Use it where usefull, don't use it any more where ... check-in: fafe0d36d9 user: jan.nijtmans tags: trunk, main | |
17:08 | Revise use of "-translation binary" in testcases: Use it where usefull, don't use it any more where ... check-in: fbb65baea8 user: jan.nijtmans tags: core-8-branch | |
16:00 | Add missing ucm2tests to generate ICU based test cases check-in: 3cd823eafe user: apnadkarni tags: trunk, main | |
Changes
Changes to tests-perf/chan.perf.tcl.
︙ | ︙ | |||
23 24 25 26 27 28 29 | namespace eval ::tclTestPerf-Chan { namespace path {::tclTestPerf} proc _get_test_chan {{bufSize 4096}} { lassign [chan pipe] ch wch; | | | | | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | namespace eval ::tclTestPerf-Chan { namespace path {::tclTestPerf} proc _get_test_chan {{bufSize 4096}} { lassign [chan pipe] ch wch; fconfigure $ch -translation lf -encoding utf-8 -buffersize $bufSize -buffering full fconfigure $wch -translation lf -encoding utf-8 -buffersize $bufSize -buffering full exec [info nameofexecutable] -- $bufSize >@$wch << { set bufSize [lindex $::argv end] fconfigure stdout -translation lf -encoding utf-8 -buffersize $bufSize -buffering full set buf [string repeat test 1000]; # 4K # write ~ 10*1M + 10*2M + 10*10M + 1*20M: set i 0; while {$i < int((10*1e6 + 10*2e6 + 10*10e6 + 1*20e6)/4e3)} { #puts -nonewline stdout $i\t puts stdout $buf #flush stdout; # don't flush to use full buffer incr i |
︙ | ︙ |
Changes to tests/chanio.test.
︙ | ︙ | |||
6731 6732 6733 6734 6735 6736 6737 | lappend result [file size $path(test1)] } -result {0 0 40} test chan-io-52.5 {TclCopyChannel, all} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] | | | | | | | | | | | | 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 | lappend result [file size $path(test1)] } -result {0 0 40} test chan-io-52.5 {TclCopyChannel, all} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 -size -1 ;# -1 means 'copy all', same as if no -size specified. set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.5a {TclCopyChannel, all, other negative value} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 -size -2 ;# < 0 behaves like -1, copy all set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.5b {TclCopyChannel, all, wrap to negative value} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 -size 3221176172 ;# Wrapped to < 0, behaves like -1, copy all set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.6 {TclCopyChannel} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 set s0 [chan copy $f1 $f2 -size [expr {[file size $thisScript] + 5}]] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {($s1 == $s2) && ($s0 == $s1)} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.7 {TclCopyChannel} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -cleanup { |
︙ | ︙ |
Changes to tests/encoding.test.
︙ | ︙ | |||
185 186 187 188 189 190 191 | append a $a set x [encoding convertfrom jis0208 $a] list [string length $x] [string index $x 0] } "512 乎" test encoding-8.1 {Tcl_ExternalToUtf} { set f [open [file join [temporaryDirectory] dummy] w] | | | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | append a $a set x [encoding convertfrom jis0208 $a] list [string length $x] [string index $x 0] } "512 乎" test encoding-8.1 {Tcl_ExternalToUtf} { set f [open [file join [temporaryDirectory] dummy] w] fconfigure $f -translation binary puts -nonewline $f "ab\x8C\xC1g" close $f set f [open [file join [temporaryDirectory] dummy] r] fconfigure $f -translation lf -encoding shiftjis set x [read $f] close $f file delete [file join [temporaryDirectory] dummy] return $x } ab乎g test encoding-9.1 {Tcl_UtfToExternalDString: small buffer} { |
︙ | ︙ | |||
213 214 215 216 217 218 219 | append a $a set x [encoding convertto jis0208 $a] list [string length $x] [string range $x 0 1] } "1024 8C" test encoding-10.1 {Tcl_UtfToExternal} { set f [open [file join [temporaryDirectory] dummy] w] | | | | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | append a $a set x [encoding convertto jis0208 $a] list [string length $x] [string range $x 0 1] } "1024 8C" test encoding-10.1 {Tcl_UtfToExternal} { set f [open [file join [temporaryDirectory] dummy] w] fconfigure $f -translation lf -encoding shiftjis puts -nonewline $f ab乎g close $f set f [open [file join [temporaryDirectory] dummy] r] fconfigure $f -translation binary set x [read $f] close $f file delete [file join [temporaryDirectory] dummy] return $x } "ab\x8C\xC1g" test encoding-11.1 {LoadEncodingFile: unknown encoding} {testencoding} { |
︙ | ︙ |
Changes to tests/ioCmd.test.
︙ | ︙ | |||
58 59 60 61 62 63 64 | fconfigure $f -translation lf -eofchar {} puts $f foobar close $f file size $path(test1) } 7 test iocmd-1.8 {puts command} { set f [open $path(test1) w] | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | fconfigure $f -translation lf -eofchar {} puts $f foobar close $f file size $path(test1) } 7 test iocmd-1.8 {puts command} { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [binary format a4a5 foo bar] close $f file size $path(test1) } 9 test iocmd-2.1 {flush command} { list [catch {flush} msg] $msg |
︙ | ︙ | |||
258 259 260 261 262 263 264 | } -cleanup { catch {close $f1} } -result {line {-blocking 1 -buffering line -buffersize 3030 -encoding utf-16 -eofchar {} -profile tcl8 -translation lf}} test iocmd-8.9 {fconfigure command} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] | | < | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | } -cleanup { catch {close $f1} } -result {line {-blocking 1 -buffering line -buffersize 3030 -encoding utf-16 -eofchar {} -profile tcl8 -translation lf}} test iocmd-8.9 {fconfigure command} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] fconfigure $f1 -translation binary -buffering none -buffersize 4040 fconfigure $f1 } -cleanup { catch {close $f1} } -result {-blocking 1 -buffering none -buffersize 4040 -encoding iso8859-1 -eofchar {} -profile strict -translation lf} test iocmd-8.10 {fconfigure command} -returnCodes error -body { fconfigure a b } -result {can not find channel named "a"} |
︙ | ︙ |