summaryrefslogtreecommitdiffstats
path: root/tests/utf.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-13 20:12:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-13 20:12:17 (GMT)
commit7d5a69fb31f8327c06f9d8bd69836dd2ff78b330 (patch)
tree615b33bf8dfcb02371549f25c5615afcce48e810 /tests/utf.test
parentbc8811c498e04f54c10a7ff1f5ec35c4682ec149 (diff)
parent5efc8e4cfbcc400b2a929dd4b828afd5308d3b53 (diff)
downloadtcl-7d5a69fb31f8327c06f9d8bd69836dd2ff78b330.zip
tcl-7d5a69fb31f8327c06f9d8bd69836dd2ff78b330.tar.gz
tcl-7d5a69fb31f8327c06f9d8bd69836dd2ff78b330.tar.bz2
Merge 8.7
Diffstat (limited to 'tests/utf.test')
-rw-r--r--tests/utf.test144
1 files changed, 45 insertions, 99 deletions
diff --git a/tests/utf.test b/tests/utf.test
index cadc971..f096f26 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -112,13 +112,10 @@ test utf-2.8.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytest
} 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
+} 2
test utf-2.9.1 {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,16 +166,16 @@ test utf-4.11 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfc
} 3
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 utf16} {
- testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end
} 2
-test utf-4.12.2 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring ucs4} {
+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.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
@@ -187,11 +184,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
@@ -213,12 +210,9 @@ 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]
+test utf-6.9 {Tcl_UtfNext} {testutfnext testbytestring} {
+ testutfnext [testbytestring \xA0\x00]
} 1
-test utf-6.9.1 {Tcl_UtfNext} {testutfnext testbytestring fullutf} {
- testutfnext [testbytestring \xA0]
-} -1
test utf-6.10 {Tcl_UtfNext} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0]G
} 1
@@ -495,30 +489,21 @@ 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 fullutf} {
+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 fullutf} {
+test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \xA0\xA0\xA0]
} 3
-test utf-6.93.0 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring ucs2} {
- testutfnext [testbytestring \x80\x80\x80]
-} 1
-test utf-6.93.1 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring fullutf} {
+test utf-6.93 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \x80\x80\x80]
} 3
-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} {
+} 3
+test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} {
testutfnext [testbytestring \x80\x80\x80\x80]
-} 1
+} 3
test utf-7.1 {Tcl_UtfPrev} testutfprev {
testutfprev {}
@@ -676,54 +661,30 @@ 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_utf16} {
+test utf-7.18.0 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xA0\xA0\xA0]
} 1
-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_utf16} {
+test utf-7.18.1 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 4
} 1
-test utf-7.18.3 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 4
-} 3
-test utf-7.18.4 {Tcl_UtfPrev} {testutfprev testbytestring ucs2_utf16} {
+test utf-7.18.2 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xA0\xA0\xA0\xF8] 4
} 1
-test utf-7.18.5 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xA0\xA0\xA0\xF8] 4
-} 3
-test utf-7.19.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2_utf16} {
+test utf-7.19 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xF8\xA0\xA0\xA0]
} 2
-test utf-7.19.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xF8\xA0\xA0\xA0]
-} 4
-test utf-7.20.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2_utf16} {
+test utf-7.20 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xF2\xA0\xA0\xA0]
} 2
-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_utf16} {
+test utf-7.21 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A\u8820[testbytestring \xA0]
} 2
-test utf-7.21.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A\u8820[testbytestring \xA0]
-} 4
-test utf-7.22.0 {Tcl_UtfPrev} {testutfprev testbytestring ucs2_utf16} {
+test utf-7.22 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xD0\xA0\xA0\xA0]
} 2
-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_utf16} {
+test utf-7.23 {Tcl_UtfPrev} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xA0\xA0\xA0\xA0]
} 2
-test utf-7.23.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xA0\xA0\xA0\xA0]
-} 4
test utf-7.24 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
testutfprev A[testbytestring \xC0\x81]
} 2
@@ -745,12 +706,9 @@ 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_utf16} {
+test utf-7.29 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xF0\x80\x80\x80]
} 2
-test utf-7.29.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xF0\x80\x80\x80]
-} 4
test utf-7.30 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
testutfprev A[testbytestring \xF0\x80\x80\x80] 4
} 3
@@ -778,12 +736,9 @@ test utf-7.37 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
test utf-7.38 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} {
testutfprev A[testbytestring \xE0\xA0\x80] 2
} 1
-test utf-7.39.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs2_utf16} {
+test utf-7.39 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring utf16} {
testutfprev A[testbytestring \xF0\x90\x80\x80]
} 2
-test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} {
- testutfprev A[testbytestring \xF0\x90\x80\x80]
-} 1
test utf-7.40.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs2} {
testutfprev A[testbytestring \xF0\x90\x80\x80] 4
} 3
@@ -808,12 +763,9 @@ 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 utf16} {
+test utf-7.46 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring utf16} {
testutfprev [testbytestring \xA0\xA0\xA0\xA0]
} 1
-test utf-7.46.1 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring ucs4} {
- testutfprev [testbytestring \xA0\xA0\xA0\xA0]
-} 3
test utf-7.47 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} {testutfprev testbytestring} {
testutfprev [testbytestring \xE8\xA0]
} 0
@@ -823,40 +775,34 @@ test utf-7.47.1 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} tes
test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} {testutfprev testbytestring} {
testutfprev [testbytestring \xE8\xA0\x00] 2
} 0
-test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev utf16} {
- testutfprev A\uDBFF\uDFFF
+test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring utf16} {
+ testutfprev A[testbytestring \xF4\x8F\xBF\xBF]
} 2
-test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} {
- testutfprev A\U10FFFF
-} 1
-test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev utf16} {
- testutfprev A\uDBFF\uDFFF 4
-} 1
-test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} {
- testutfprev A\U10FFFF 4
-} 1
-test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev utf16} {
- testutfprev A\uDBFF\uDFFF 3
+test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs2} {
+ testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 4
+} 3
+test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring fullutf} {
+ testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 4
} 1
-test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} {
- testutfprev A\U10FFFF 3
+test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs2} {
+ testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 3
+} 2
+test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring fullutf} {
+ testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 3
} 1
-test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
- testutfprev A\U10FFFF 2
+test utf-7.48.5 {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 utf16} {
testutfprev A[testbytestring \xF4\x90\x80\x80]
} 2
-test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} {
- 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