summaryrefslogtreecommitdiffstats
path: root/tests/utf.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utf.test')
-rw-r--r--tests/utf.test68
1 files changed, 40 insertions, 28 deletions
diff --git a/tests/utf.test b/tests/utf.test
index 8ad169e..b164b6a 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -15,6 +15,9 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
namespace path ::tcl::mathop
+::tcltest::loadTestedCommands
+catch [list package require -exact Tcltest [info patchlevel]]
+
testConstraint ucs2 [expr {[format %c 0x010000] eq "\uFFFD"}]
testConstraint fullutf [expr {[format %c 0x010000] ne "\uFFFD"}]
testConstraint tip389 [expr {[string length [format %c 0x10000]] eq 2}]
@@ -484,7 +487,10 @@ test utf-6.90.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs2} {
test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} {
testutfnext \xF4\x8F\xBF\xBF
} 4
-test utf-6.91 {Tcl_UtfNext, validity check [493dccc2de]} testutfnext {
+test utf-6.91.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs2} {
+ testutfnext \xF4\x90\x80\x80
+} 1
+test utf-6.91.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} {
testutfnext \xF4\x90\x80\x80
} 1
test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} testutfnext {
@@ -496,7 +502,7 @@ test utf-6.93 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} tes
test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext {
testutfnext \xA0\xA0\xA0\xA0
} 1
-test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext {
+test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext ucs2} {
testutfnext \x80\x80\x80\x80
} 1
test utf-6.96 {Tcl_UtfNext, read limits} testutfnext {
@@ -592,16 +598,16 @@ test utf-6.117.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.118 {Tcl_UtfNext, read limits} testutfnext {
testutfnext \xA0G 0
} 0
-test utf-6.119 {Tcl_UtfNext, read limits} testutfnext {
+test utf-6.119 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
testutfnext \xA0G 1
} 1
-test utf-6.120 {Tcl_UtfNext, read limits} testutfnext {
+test utf-6.120 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
testutfnext \xA0\xA0 1
} 1
-test utf-6.121 {Tcl_UtfNext, read limits} testutfnext {
+test utf-6.121 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
testutfnext \xA0\xA0G 2
} 1
-test utf-6.122 {Tcl_UtfNext, read limits} testutfnext {
+test utf-6.122 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
testutfnext \xA0\xA0\xA0 2
} 1
test utf-6.123 {Tcl_UtfNext, read limits} testutfnext {
@@ -775,49 +781,49 @@ test utf-7.17.2 {Tcl_UtfPrev} testutfprev {
} 3
test utf-7.18.0 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xA0\xA0\xA0
-} 3
+} 1
test utf-7.18.1 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xA0\xA0\xA0
} 3
test utf-7.18.2 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xA0\xA0\xA0\xA0 4
-} 3
+} 1
test utf-7.18.3 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xA0\xA0\xA0\xA0 4
} 3
test utf-7.18.4 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xA0\xA0\xA0\xF8 4
-} 3
+} 1
test utf-7.18.5 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xA0\xA0\xA0\xF8 4
} 3
test utf-7.19.0 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xF8\xA0\xA0\xA0
-} 4
+} 2
test utf-7.19.1 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xF8\xA0\xA0\xA0
} 4
test utf-7.20.0 {Tcl_UtfPrev} {testutfprev ucs2} {
- testutfprev A\xF2\xA0\xA0\xA0
-} 4
+ testutfprev A\xF4\xA0\xA0\xA0
+} 2
test utf-7.20.1 {Tcl_UtfPrev} {testutfprev fullutf} {
- testutfprev A\xF2\xA0\xA0\xA0
-} 1
+ testutfprev A\xF4\xA0\xA0\xA0
+} 4
test utf-7.21.0 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xE8\xA0\xA0\xA0
-} 4
+} 2
test utf-7.21.1 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xE8\xA0\xA0\xA0
} 4
test utf-7.22.0 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xD0\xA0\xA0\xA0
-} 4
+} 2
test utf-7.22.1 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xD0\xA0\xA0\xA0
} 4
test utf-7.23.0 {Tcl_UtfPrev} {testutfprev ucs2} {
testutfprev A\xA0\xA0\xA0\xA0
-} 4
+} 2
test utf-7.23.1 {Tcl_UtfPrev} {testutfprev fullutf} {
testutfprev A\xA0\xA0\xA0\xA0
} 4
@@ -844,7 +850,7 @@ test utf-7.28.1 {Tcl_UtfPrev -- overlong sequence} testutfprev {
} 1
test utf-7.29.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs2} {
testutfprev A\xF0\x80\x80\x80
-} 4
+} 2
test utf-7.29.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev fullutf} {
testutfprev A\xF0\x80\x80\x80
} 4
@@ -877,7 +883,7 @@ test utf-7.38 {Tcl_UtfPrev -- overlong sequence} testutfprev {
} 1
test utf-7.39.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs2} {
testutfprev A\xF0\x90\x80\x80
-} 4
+} 2
test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev fullutf} {
testutfprev A\xF0\x90\x80\x80
} 1
@@ -907,7 +913,7 @@ test utf-7.45 {Tcl_UtfPrev -- no lead byte at start} testutfprev {
} 2
test utf-7.46.0 {Tcl_UtfPrev -- no lead byte at start} {testutfprev ucs2} {
testutfprev \xA0\xA0\xA0\xA0
-} 3
+} 1
test utf-7.46.1 {Tcl_UtfPrev -- no lead byte at start} {testutfprev fullutf} {
testutfprev \xA0\xA0\xA0\xA0
} 3
@@ -922,7 +928,7 @@ test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} t
} 0
test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
testutfprev A\xF4\x8F\xBF\xBF
-} 4
+} 2
test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
testutfprev A\xF4\x8F\xBF\xBF
} 1
@@ -943,17 +949,23 @@ test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev {
} 1
test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
testutfprev A\xF4\x90\x80\x80
-} 4
+} 2
test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
testutfprev A\xF4\x90\x80\x80
} 4
-test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev {
+test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
testutfprev A\xF4\x90\x80\x80 4
} 3
-test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev {
+test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
+ testutfprev A\xF4\x90\x80\x80 4
+} 3
+test utf-7.49.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
+ testutfprev A\xF4\x90\x80\x80 3
+} 2
+test utf-7.49.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
testutfprev A\xF4\x90\x80\x80 3
} 2
-test utf-7.49.4 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev {
+test utf-7.49.6 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev {
testutfprev A\xF4\x90\x80\x80 2
} 1
@@ -1321,7 +1333,7 @@ test utf-19.1 {TclUniCharLen} -body {
unset -nocomplain foo
} -result {1 4}
-test utf-20.1 {TclUniCharNcmp} {fullutf} {
+test utf-20.1 {TclUniCharNcmp} {fullutf knownBug} {
string compare [string range [format %c 0xFFFF] 0 0] [string range [format %c 0x10000] 0 0]
} -1
@@ -1442,8 +1454,8 @@ UniCharCaseCmpTest < a b
UniCharCaseCmpTest > b a
UniCharCaseCmpTest > B a
UniCharCaseCmpTest > aBcB abca
-UniCharCaseCmpTest < \uFFFF [format %c 0x10000] fullutf
-UniCharCaseCmpTest < \uFFFF \U10000 {Uesc fullutf}
+UniCharCaseCmpTest < \uFFFF [format %c 0x10000] {fullutf knownBug}
+UniCharCaseCmpTest < \uFFFF \U10000 {Uesc fullutf knownBug}