summaryrefslogtreecommitdiffstats
path: root/tests/utf.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-12 10:08:13 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-12 10:08:13 (GMT)
commitf5439dbff5f371ec20c17c7bcc6930e7edc7d02b (patch)
treec287a9bb2493b687ec3426e0ff6e683c2ae67055 /tests/utf.test
parent80317c0d6d466a184a6f8c711981d601541deb89 (diff)
downloadtcl-f5439dbff5f371ec20c17c7bcc6930e7edc7d02b.zip
tcl-f5439dbff5f371ec20c17c7bcc6930e7edc7d02b.tar.gz
tcl-f5439dbff5f371ec20c17c7bcc6930e7edc7d02b.tar.bz2
Unsplit some test-cases and renumber, for testcase which give the same results for different TCL_UTF_MAX values.
Diffstat (limited to 'tests/utf.test')
-rw-r--r--tests/utf.test146
1 files changed, 46 insertions, 100 deletions
diff --git a/tests/utf.test b/tests/utf.test
index 2c16c85..70b6d1b 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -103,21 +103,21 @@ test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestrin
test utf-2.8.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} {
string length [testbytestring \xF0\x90\x80\x80]
} 4
-test utf-2.8.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} {
- string length [testbytestring \xF0\x90\x80\x80]
-} 1
-test utf-2.8.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring utf16} {
+test utf-2.8.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring utf16} {
string length [testbytestring \xF0\x90\x80\x80]
} 2
+test utf-2.8.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} {
+ string length [testbytestring \xF0\x90\x80\x80]
+} 1
test utf-2.9.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} {
string length [testbytestring \xF4\x8F\xBF\xBF]
} 4
-test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {Uesc ucs4} {
+test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring utf16} {
+ string length [testbytestring \xF4\x8F\xBF\xBF]
+} 2
+test utf-2.9.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {Uesc ucs4} {
string length \U10FFFF
} 1
-test utf-2.9.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} utf16 {
- string length \uDBFF\uDFFF
-} 2
test utf-2.10 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, underflow} testbytestring {
string length [testbytestring \xF0\x8F\xBF\xBF]
} 4
@@ -169,15 +169,18 @@ test utf-4.11 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfc
test utf-4.12.0 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring ucs2} {
testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end
} 4
-test utf-4.12.1 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring ucs4} {
- testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end
-} 1
-test utf-4.12.2 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring utf16} {
+test utf-4.12.1 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring utf16} {
testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end
} 2
-test utf-4.13 {Tcl_NumUtfChars: end of string} {testnumutfchars testbytestring} {
+test utf-4.12.2 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring ucs4} {
+ testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end
+} 1
+test utf-4.13 {Tcl_NumUtfChars: end of string} {testnumutfchars testbytestring} {
testnumutfchars foobar[testbytestring \xF2\xC2\xA0] end
} 8
+test utf-4.14 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfchars testbytestring} {
+ testnumutfchars [testbytestring \xF4\x90\x80\x80] end-1
+} 3
test utf-5.1 {Tcl_UtfFindFirst} {testfindfirst testbytestring} {
testfindfirst [testbytestring abcbc] 98
@@ -186,11 +189,11 @@ test utf-5.2 {Tcl_UtfFindLast} {testfindlast testbytestring} {
testfindlast [testbytestring abcbc] 98
} bc
-test utf-6.1 {Tcl_UtfNext} testutfnext {
+test utf-6.1 {Tcl_UtfNext} {testutfnext testbytestring} {
# This takes the pointer one past the terminating NUL.
# This is really an invalid call.
- testutfnext {}
-} -1
+ testutfnext [testbytestring \x00]
+} 1
test utf-6.2 {Tcl_UtfNext} testutfnext {
testutfnext A
} 1
@@ -212,20 +215,14 @@ test utf-6.7 {Tcl_UtfNext} {testutfnext testbytestring} {
test utf-6.8 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext A[testbytestring \xF8]
} 1
-test utf-6.9.0 {Tcl_UtfNext} {testutfnext testbytestring ucs2} {
- testutfnext [testbytestring \xA0]
-} 1
-test utf-6.9.1 {Tcl_UtfNext} {testutfnext testbytestring utf16} {
- testutfnext [testbytestring \xA0]
-} -1
-test utf-6.9.2 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
+test utf-6.9 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0]
} 1
test utf-6.10 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0]G
} 1
test utf-6.11 {Tcl_UtfNext} {testutfnext testbytestring} {
- testutfnext [testbytestring \xA0\xA0]
+ testutfnext [testbytestring \xA0\xA0\x00]
} 1
test utf-6.12 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0\xD0]
@@ -284,10 +281,7 @@ test utf-6.29 {Tcl_UtfNext} {testutfnext testbytestring} {
test utf-6.30.0 {Tcl_UtfNext} {testutfnext testbytestring ucs2} {
testutfnext [testbytestring \xF2]
} 1
-test utf-6.30.1 {Tcl_UtfNext} {testutfnext testbytestring utf16} {
- testutfnext [testbytestring \xF2]
-} 1
-test utf-6.30.2 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
+test utf-6.30.1 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
testutfnext [testbytestring \xF2]
} -1
test utf-6.31 {Tcl_UtfNext} {testutfnext testbytestring} {
@@ -296,10 +290,7 @@ test utf-6.31 {Tcl_UtfNext} {testutfnext testbytestring} {
test utf-6.32.0 {Tcl_UtfNext} {testutfnext testbytestring ucs2} {
testutfnext [testbytestring \xF2\xA0]
} 1
-test utf-6.32.1 {Tcl_UtfNext} {testutfnext testbytestring utf16} {
- testutfnext [testbytestring \xF2\xA0]
-} 1
-test utf-6.32.2 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
+test utf-6.32.1 {Tcl_UtfNext} {testutfnext testbytestring ucs4} {
testutfnext [testbytestring \xF2\xA0]
} -1
test utf-6.33 {Tcl_UtfNext} {testutfnext testbytestring} {
@@ -503,34 +494,19 @@ test utf-6.90.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbyte
test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring ucs4} {
testutfnext [testbytestring \xF4\x8F\xBF\xBF]
} 4
-test utf-6.91.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring ucs2} {
- testutfnext [testbytestring \xF4\x90\x80\x80]
-} 1
-test utf-6.91.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring ucs4} {
+test utf-6.91 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring} {
testutfnext [testbytestring \xF4\x90\x80\x80]
} 1
-test utf-6.92.0 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext testbytestring ucs2} {
- testutfnext [testbytestring \xA0\xA0\xA0]
-} 1
-test utf-6.92.1 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext testbytestring utf16} {
- testutfnext [testbytestring \xA0\xA0\xA0]
-} 3
-test utf-6.92.2 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext testbytestring ucs4} {
+test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0\xA0\xA0]
} 1
-test utf-6.93.0 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring ucs2} {
+test utf-6.93 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \x80\x80\x80]
} 1
-test utf-6.93.1 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring utf16} {
- testutfnext [testbytestring \x80\x80\x80]
-} 3
-test utf-6.93.2 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring ucs4} {
- testutfnext [testbytestring \x80\x80\x80]
-} 1
-test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring ucs2} {
+test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0\xA0\xA0\xA0]
} 1
-test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring ucs2} {
+test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \x80\x80\x80\x80]
} 1
test utf-6.96 {Tcl_UtfNext, read limits} testutfnext {
@@ -777,16 +753,16 @@ test utf-7.15.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
test utf-7.15.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
testutfprev A[testbytestring \xF2\xA0\xA0]
} 1
-test utf-7.15.1.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
+test utf-7.15.2 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 4
} 3
-test utf-7.15.1.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.15.3 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 4
} 1
-test utf-7.15.2.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
+test utf-7.15.4 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
testutfprev A[testbytestring \xF2\xA0\xA0\xF8] 4
} 3
-test utf-7.15.2.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.15.5 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
testutfprev A[testbytestring \xF2\xA0\xA0\xF8] 4
} 1
test utf-7.16 {Tcl_UtfPrev} testutfprev {
@@ -807,28 +783,16 @@ test utf-7.17.1 {Tcl_UtfPrev} {testutfprev testbytestring} {
test utf-7.17.2 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xD0\xA0\xA0\xF8] 4
} 3
-test utf-7.18.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
+test utf-7.18.0 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xA0\xA0\xA0]
} 3
-test utf-7.18.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xA0\xA0\xA0]
-} 3
-test utf-7.18.2 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
- testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 4
-} 3
-test utf-7.18.3 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.18.1 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 4
} 3
-test utf-7.18.4 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
- testutfprev A[testbytestring \xA0\xA0\xA0\xF8] 4
-} 3
-test utf-7.18.5 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.18.2 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xA0\xA0\xA0\xF8] 4
} 3
-test utf-7.19.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
- testutfprev A[testbytestring \xF8\xA0\xA0\xA0]
-} 4
-test utf-7.19.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.19 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF8\xA0\xA0\xA0]
} 4
test utf-7.20.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
@@ -837,22 +801,13 @@ test utf-7.20.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
test utf-7.20.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
testutfprev A[testbytestring \xF2\xA0\xA0\xA0]
} 1
-test utf-7.21.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
- testutfprev A\u8820[testbytestring \xA0]
-} 4
-test utf-7.21.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.21 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A\u8820[testbytestring \xA0]
} 4
-test utf-7.22.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
+test utf-7.22 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xD0\xA0\xA0\xA0]
} 4
-test utf-7.22.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xD0\xA0\xA0\xA0]
-} 4
-test utf-7.23.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2} {
- testutfprev A[testbytestring \xA0\xA0\xA0\xA0]
-} 4
-test utf-7.23.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
+test utf-7.23 {Tcl_UtfPrev} {testutfprev testbytestring} {
testutfprev A[testbytestring \xA0\xA0\xA0\xA0]
} 4
test utf-7.24 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
@@ -876,10 +831,7 @@ test utf-7.28 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
test utf-7.28.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
testutfprev A[testbytestring \xE0\x80\x80] 2
} 1
-test utf-7.29.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs2} {
- testutfprev A[testbytestring \xF0\x80\x80\x80]
-} 4
-test utf-7.29.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} {
+test utf-7.29 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF0\x80\x80\x80]
} 4
test utf-7.30 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
@@ -939,10 +891,7 @@ test utf-7.44 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestrin
test utf-7.45 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} {
testutfprev [testbytestring \xA0\xA0\xA0]
} 2
-test utf-7.46.0 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring ucs2} {
- testutfprev [testbytestring \xA0\xA0\xA0\xA0]
-} 3
-test utf-7.46.1 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring ucs4} {
+test utf-7.46 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} {
testutfprev [testbytestring \xA0\xA0\xA0\xA0]
} 3
test utf-7.47 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} {testutfprev testbytestring} {
@@ -975,19 +924,16 @@ test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbyte
test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 2
} 1
-test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs2} {
- testutfprev A[testbytestring \xF4\x90\x80\x80]
-} 4
-test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} {
+test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF4\x90\x80\x80]
} 4
-test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
+test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF4\x90\x80\x80] 4
} 3
-test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
+test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF4\x90\x80\x80] 3
} 2
-test utf-7.49.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
+test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF4\x90\x80\x80] 2
} 1
@@ -1493,7 +1439,7 @@ UniCharCaseCmpTest > \U10000 \uFFFF {Uesc ucs4}
test utf-26.1 {Tcl_UniCharDString} -setup {
testobj freeallvars
-} -constraints {teststringobj} -cleanup {
+} -constraints {teststringobj testbytestring} -cleanup {
testobj freeallvars
} -body {
teststringobj set 1 foo