diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-04 09:37:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-04 09:37:15 (GMT) |
commit | 35051648affc3b6e48d6abe8f629810f28a80112 (patch) | |
tree | 7623d6b900bdcaca10fbd58a346febd0a5c8ca80 /tests/encoding.test | |
parent | 58ce7d319f84db00c8863a8a27d366a34e60756c (diff) | |
download | tcl-35051648affc3b6e48d6abe8f629810f28a80112.zip tcl-35051648affc3b6e48d6abe8f629810f28a80112.tar.gz tcl-35051648affc3b6e48d6abe8f629810f28a80112.tar.bz2 |
Test-case cleanup. Increase timeout a little bit in main.test, making Travis build errors because of this less likely.
Diffstat (limited to 'tests/encoding.test')
-rw-r--r-- | tests/encoding.test | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index 67317c2..43c3c4c 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -1,12 +1,12 @@ # This file contains a collection of tests for tclEncoding.c -# Sourcing this file into Tcl runs the tests and generates output for -# errors. No output means no errors were found. +# Sourcing this file into Tcl runs the tests and generates output for errors. +# No output means no errors were found. # # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# See the file "license.terms" for information on usage and redistribution of +# this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcltest 2 @@ -31,8 +31,8 @@ proc runtests {} { # Some tests require the testencoding command testConstraint testencoding [llength [info commands testencoding]] testConstraint exec [llength [info commands exec]] -testConstraint fullutf [expr {[format %c 0x010000] ne "\uFFFD"}] - +testConstraint Uesc [expr {"\U0041" eq "A"}] + # TclInitEncodingSubsystem is tested by the rest of this file # TclFinalizeEncodingSubsystem is not currently tested @@ -66,7 +66,7 @@ test encoding-2.2 {Tcl_FreeEncoding: refcount != 0} {testencoding} { set path [encoding dirs] encoding system shiftjis ;# incr ref count encoding dirs [list [pwd]] - set x [encoding convertto shiftjis \u4e4e] ;# old one found + set x [encoding convertto shiftjis \u4E4E] ;# old one found encoding system iso8859-1 llength shiftjis lappend x [catch {encoding convertto shiftjis \u4e4e} msg] $msg @@ -170,7 +170,7 @@ test encoding-8.1 {Tcl_ExternalToUtf} { puts -nonewline $f "ab\x8c\xc1g" close $f set f [open [file join [temporaryDirectory] dummy] r] - fconfigure $f -translation binary -encoding shiftjis + fconfigure $f -translation binary -encoding shiftjis set x [read $f] close $f file delete [file join [temporaryDirectory] dummy] @@ -222,7 +222,7 @@ test encoding-11.1 {LoadEncodingFile: unknown encoding} {testencoding} { set path [encoding dirs] encoding system iso8859-1 encoding dirs {} - llength jis0208 + llength jis0208 ;# Shimmer any cached Tcl_Encoding in shared literal set x [list [catch {encoding convertto jis0208 \u4e4e} msg] $msg] encoding dirs $path encoding system $system @@ -252,7 +252,7 @@ test encoding-11.6 {LoadEncodingFile: invalid file} {testencoding} { makeDirectory tmp makeDirectory [file join tmp encoding] set f [open [file join tmp encoding splat.enc] w] - fconfigure $f -translation binary + fconfigure $f -translation binary puts $f "abcdefghijklmnop" close $f set x [list [catch {encoding convertto splat \u4e4e} msg] $msg] @@ -273,11 +273,11 @@ test encoding-12.1 {LoadTableEncoding: normal encoding} { append x [encoding convertfrom iso8859-3 \xD5] } "\xd5?\u120" test encoding-12.2 {LoadTableEncoding: single-byte encoding} { - set x [encoding convertto iso8859-3 ab\u0120g] + set x [encoding convertto iso8859-3 ab\u0120g] append x [encoding convertfrom iso8859-3 ab\xD5g] } "ab\xd5gab\u120g" test encoding-12.3 {LoadTableEncoding: multi-byte encoding} { - set x [encoding convertto shiftjis ab\u4E4Eg] + set x [encoding convertto shiftjis ab\u4E4Eg] append x [encoding convertfrom shiftjis ab\x8c\xc1g] } "ab\x8c\xc1gab\u4e4eg" test encoding-12.4 {LoadTableEncoding: double-byte encoding} { @@ -289,7 +289,7 @@ test encoding-12.5 {LoadTableEncoding: symbol encoding} { append x [encoding convertto symbol \u67] append x [encoding convertfrom symbol \x67] } "\x67\x67\u3b3" -test encoding-12.6 {LoadTableEncoding: overflow in char value} fullutf { +test encoding-12.6 {LoadTableEncoding: overflow in char value} Uesc { encoding convertto iso8859-3 \U010000 } "?" @@ -586,7 +586,7 @@ foreach from {cp932 shiftjis euc-jp iso2022-jp} { puts -nonewline $out [read $f] close $out close $f - + # then compare $to.chars <=> $from.to.tcltestout as binary. set fa [open $to.chars] fconfigure $fa -encoding binary @@ -595,7 +595,7 @@ foreach from {cp932 shiftjis euc-jp iso2022-jp} { set diff [channel-diff $fa $fb] close $fa close $fb - + # Difference should be empty. set diff } {} @@ -605,7 +605,7 @@ foreach from {cp932 shiftjis euc-jp iso2022-jp} { testConstraint testgetdefenc [llength [info commands testgetdefenc]] test encoding-26.0 {Tcl_GetDefaultEncodingDir} -constraints { - testgetdefenc + testgetdefenc } -setup { set origDir [testgetdefenc] testsetdefenc slappy |