From 45b096ac88e551fb40f84b02f14bd6bb2cdfdcdb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 29 Apr 2020 11:10:44 +0000 Subject: Better structurize the UTF-8 (mainly around Tcl_UtfNext()/Tcl_UtfPrev(), but not only those) test-cases: Selector "ucs2" is meant for Tcl 8.5: No knowledge at all about 4-byte sequences. Selector "ucs4" is meant for Tcl 8.5 or 8.7 with TCL_UTF_MAX=4 or Tcl 8.6 with TCL_UTF_MAX=6 Selector "tip389" is meant for Tcl 8.6 with TCL_UTF_MAX=4 and Tcl 8.7 with TCL_UTF_MAX=3 (of course, this is too simple: there will be testcases needing more than those 3 --- generic/tclTest.c | 29 +- tests/utf.test | 896 +++++++++++++++++++++++++++--------------------------- 2 files changed, 454 insertions(+), 471 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 2178647..4c13850 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -6825,21 +6825,14 @@ TestUtfNextCmd( char *bytes; const char *result, *first; char buffer[32]; - static const char tobetested[] = "\xFF\xFE\xF4\xF2\xF0\xEF\xE8\xE3\xE2\xE1\xE0\xC2\xC1\xC0\x82"; + static const char tobetested[] = "A\xA0\xC0\xC1\xC2\xD0\xE0\xE8\xF2\xF7\xF8\xFE\xFF"; const char *p = tobetested; - if (objc != 3 || strcmp(Tcl_GetString(objv[1]), "-bytestring")) { - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "?-bytestring? bytes"); - return TCL_ERROR; - } - bytes = Tcl_GetStringFromObj(objv[1], &numBytes); - } else { - bytes = (char *) TclGetBytesFromObj(interp, objv[2], &numBytes); - if (bytes == NULL) { - return TCL_ERROR; - } + if (objc != 2) { + Tcl_WrongNumArgs(interp, 1, objv, "?-bytestring? bytes"); + return TCL_ERROR; } + bytes = Tcl_GetStringFromObj(objv[1], &numBytes); if (numBytes > (int)sizeof(buffer)-3) { Tcl_AppendResult(interp, "\"testutfnext\" can only handle 29 bytes", NULL); @@ -6888,17 +6881,13 @@ TestUtfPrevCmd( int numBytes, offset; char *bytes; const char *result; - Tcl_Obj *copy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "bytes ?offset?"); return TCL_ERROR; } - bytes = (char *) TclGetBytesFromObj(interp, objv[1], &numBytes); - if (bytes == NULL) { - return TCL_ERROR; - } + bytes = Tcl_GetStringFromObj(objv[1], &numBytes); if (objc == 3) { if (TCL_OK != Tcl_GetIntForIndex(interp, objv[2], numBytes, &offset)) { @@ -6913,14 +6902,8 @@ TestUtfPrevCmd( } else { offset = numBytes; } - copy = Tcl_DuplicateObj(objv[1]); - bytes = (char *) Tcl_SetByteArrayLength(copy, numBytes+1); - bytes[numBytes] = '\0'; - result = TclUtfPrev(bytes + offset, bytes); Tcl_SetObjResult(interp, Tcl_NewIntObj(result - bytes)); - - Tcl_DecrRefCount(copy); return TCL_OK; } diff --git a/tests/utf.test b/tests/utf.test index feb3f56..811002d 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -42,96 +42,96 @@ testConstraint tip413 [eq {} [string trim \x00]] catch {unset x} test utf-1.1 {Tcl_UniCharToUtf: 1 byte sequences} testbytestring { - expr {"\x01" eq [testbytestring "\x01"]} + expr {"\x01" eq [testbytestring \x01]} } 1 test utf-1.2 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { - expr {"\x00" eq [testbytestring "\xC0\x80"]} + expr {"\x00" eq [testbytestring \xC0\x80]} } 1 test utf-1.3 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { - expr {"\xE0" eq [testbytestring "\xC3\xA0"]} + expr {"\xE0" eq [testbytestring \xC3\xA0]} } 1 test utf-1.4 {Tcl_UniCharToUtf: 3 byte sequences} testbytestring { - expr {"\u4E4E" eq [testbytestring "\xE4\xB9\x8E"]} + expr {"\u4E4E" eq [testbytestring \xE4\xB9\x8E]} } 1 test utf-1.5 {Tcl_UniCharToUtf: overflowed Tcl_UniChar} testbytestring { - expr {[format %c 0x110000] eq [testbytestring "\xEF\xBF\xBD"]} + expr {[format %c 0x110000] eq [testbytestring \xEF\xBF\xBD]} } 1 test utf-1.6 {Tcl_UniCharToUtf: negative Tcl_UniChar} testbytestring { - expr {[format %c -1] eq [testbytestring "\xEF\xBF\xBD"]} + expr {[format %c -1] eq [testbytestring \xEF\xBF\xBD]} } 1 test utf-1.7.0 {Tcl_UniCharToUtf: 4 byte sequences} {fullutf Uesc testbytestring} { - expr {"\U014E4E" eq [testbytestring "\xF0\x94\xB9\x8E"]} + expr {"\U014E4E" eq [testbytestring \xF0\x94\xB9\x8E]} } 1 test utf-1.7.1 {Tcl_UniCharToUtf: 4 byte sequences} {ucs2 Uesc testbytestring} { - expr {"\U014E4E" eq [testbytestring "\xF0\x94\xB9\x8E"]} + expr {"\U014E4E" eq [testbytestring \xF0\x94\xB9\x8E]} } 0 test utf-1.8 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { - expr {"\uD842" eq [testbytestring "\xED\xA1\x82"]} + expr {"\uD842" eq [testbytestring \xED\xA1\x82]} } 1 test utf-1.9 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { - expr {"\uDC42" eq [testbytestring "\xED\xB1\x82"]} + expr {"\uDC42" eq [testbytestring \xED\xB1\x82]} } 1 test utf-1.10 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { - expr {[format %c 0xD842] eq [testbytestring "\xED\xA1\x82"]} + expr {[format %c 0xD842] eq [testbytestring \xED\xA1\x82]} } 1 test utf-1.11 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { - expr {[format %c 0xDC42] eq [testbytestring "\xED\xB1\x82"]} + expr {[format %c 0xDC42] eq [testbytestring \xED\xB1\x82]} } 1 test utf-1.12 {Tcl_UniCharToUtf: 4 byte sequence, high/low surrogate} {pairsTo4bytes testbytestring} { - expr {"\uD842\uDC42" eq [testbytestring "\xF0\xA0\xA1\x82"]} + expr {"\uD842\uDC42" eq [testbytestring \xF0\xA0\xA1\x82]} } 1 test utf-1.13 {Tcl_UniCharToUtf: Invalid surrogate} {Uesc testbytestring} { - expr {"\UD842" eq [testbytestring "\xEF\xBF\xBD"]} + expr {"\UD842" eq [testbytestring \xEF\xBF\xBD]} } 1 test utf-2.1 {Tcl_UtfToUniChar: low ascii} { string length "abc" } 3 test utf-2.2 {Tcl_UtfToUniChar: naked trail bytes} testbytestring { - string length [testbytestring "\x82\x83\x84"] + string length [testbytestring \x82\x83\x84] } 3 test utf-2.3 {Tcl_UtfToUniChar: lead (2-byte) followed by non-trail} testbytestring { - string length [testbytestring "\xC2"] + string length [testbytestring \xC2] } 1 test utf-2.4 {Tcl_UtfToUniChar: lead (2-byte) followed by trail} testbytestring { - string length [testbytestring "\xC2\xA2"] + string length [testbytestring \xC2\xA2] } 1 test utf-2.5 {Tcl_UtfToUniChar: lead (3-byte) followed by non-trail} testbytestring { - string length [testbytestring "\xE2"] + string length [testbytestring \xE2] } 1 test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestring { - string length [testbytestring "\xE2\xA2"] + string length [testbytestring \xE2\xA2] } 2 test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring { - string length [testbytestring "\xE4\xB9\x8E"] + string length [testbytestring \xE4\xB9\x8E] } 1 test utf-2.8.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} { - string length [testbytestring "\xF0\x90\x80\x80"] + 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"] + string length [testbytestring \xF0\x90\x80\x80] } 1 test utf-2.8.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring tip389} { - string length [testbytestring "\xF0\x90\x80\x80"] + string length [testbytestring \xF0\x90\x80\x80] } 2 test utf-2.9.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} { - string length [testbytestring "\xF4\x8F\xBF\xBF"] + string length [testbytestring \xF4\x8F\xBF\xBF] } 4 -test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} { - string length [testbytestring "\xF4\x8F\xBF\xBF"] +test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} ucs4 { + string length \U10FFFF } 1 -test utf-2.9.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring tip389} { - string length [testbytestring "\xF4\x8F\xBF\xBF"] +test utf-2.9.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} !ucs4 { + 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"] + string length [testbytestring \xF0\x8F\xBF\xBF] } 4 test utf-2.11 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, overflow} testbytestring { # Would decode to U+110000 but that is outside the Unicode range. - string length [testbytestring "\xF4\x90\x80\x80"] + string length [testbytestring \xF4\x90\x80\x80] } 4 test utf-2.12 {Tcl_UtfToUniChar: longer UTF sequences not supported} testbytestring { - string length [testbytestring "\xF8\xA2\xA2\xA2\xA2"] + string length [testbytestring \xF8\xA2\xA2\xA2\xA2] } 5 test utf-3.1 {Tcl_UtfCharComplete} { @@ -141,32 +141,32 @@ test utf-4.1 {Tcl_NumUtfChars: zero length} testnumutfchars { testnumutfchars "" } 0 test utf-4.2 {Tcl_NumUtfChars: length 1} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xC2\xA2"] + testnumutfchars [testbytestring \xC2\xA2] } 1 test utf-4.3 {Tcl_NumUtfChars: long string} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E"] + testnumutfchars [testbytestring abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E] } 7 test utf-4.4 {Tcl_NumUtfChars: #u0000} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xC0\x80"] + testnumutfchars [testbytestring \xC0\x80] } 1 test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} testnumutfchars { testnumutfchars "" 0 } 0 test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xC2\xA2"] end + testnumutfchars [testbytestring \xC2\xA2] end } 1 test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E"] end + testnumutfchars [testbytestring abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E] end } 7 test utf-4.8 {Tcl_NumUtfChars: #u0000, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xC0\x80"] end + testnumutfchars [testbytestring \xC0\x80] end } 1 # Bug [2738427]: Tcl_NumUtfChars(...) no overflow check test utf-4.9 {Tcl_NumUtfChars: #u20AC, calc len, incomplete} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xE2\x82\xAC"] end-1 + testnumutfchars [testbytestring \xE2\x82\xAC] end-1 } 2 test utf-4.10 {Tcl_NumUtfChars: #u0000, calc len, overcomplete} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\x00"] end+1 + testnumutfchars [testbytestring \x00] end+1 } 2 test utf-4.11 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfchars testbytestring} { testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end-1 @@ -182,325 +182,325 @@ test utf-4.12.2 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars test } 2 test utf-5.1 {Tcl_UtfFindFirst} {testfindfirst testbytestring} { - testfindfirst [testbytestring "abcbc"] 98 + testfindfirst [testbytestring abcbc] 98 } bcbc test utf-5.2 {Tcl_UtfFindLast} {testfindlast testbytestring} { - testfindlast [testbytestring "abcbc"] 98 + 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 -bytestring {} + testutfnext [testbytestring {}] } 1 test utf-6.2 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring A + testutfnext A } 1 test utf-6.3 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring AA + testutfnext AA } 1 -test utf-6.4 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring A\xA0 +test utf-6.4 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext A[testbytestring \xA0] } 1 -test utf-6.5 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring A\xD0 +test utf-6.5 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext A[testbytestring \xD0] } 1 -test utf-6.6 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring A\xE8 +test utf-6.6 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext A[testbytestring \xE8] } 1 -test utf-6.7 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring A\xF2 +test utf-6.7 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext A[testbytestring \xF2] } 1 -test utf-6.8 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring A\xF8 +test utf-6.8 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext A[testbytestring \xF8] } 1 -test utf-6.9 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0\x00 +test utf-6.9 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\x00] } 1 -test utf-6.10 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0G +test utf-6.10 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0]G } 1 -test utf-6.11 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0\xA0\x00 +test utf-6.11 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xA0\x00] } 2 -test utf-6.12 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0\xD0 +test utf-6.12 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xD0] } 1 -test utf-6.13 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0\xE8 +test utf-6.13 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xE8] } 1 -test utf-6.14 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0\xF2 +test utf-6.14 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xF2] } 1 -test utf-6.15 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xA0\xF8 +test utf-6.15 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xF8] } 1 -test utf-6.16 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\x00 +test utf-6.16 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\x00] } 1 -test utf-6.17 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0G +test utf-6.17 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0]G } 1 -test utf-6.18 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0 +test utf-6.18 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0] } 2 -test utf-6.19 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xD0 +test utf-6.19 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xD0] } 1 -test utf-6.20 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xE8 +test utf-6.20 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xE8] } 1 -test utf-6.21 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xF2 +test utf-6.21 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xF2] } 1 -test utf-6.22 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xF8 +test utf-6.22 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xF8] } 1 -test utf-6.23 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8 +test utf-6.23 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8] } 1 -test utf-6.24 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8G +test utf-6.24 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8]G } 1 -test utf-6.25 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\x00 +test utf-6.25 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xA0\x00] } 1 -test utf-6.26 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xD0 +test utf-6.26 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xD0] } 1 -test utf-6.27 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xE8 +test utf-6.27 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xE8] } 1 -test utf-6.28 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xF2 +test utf-6.28 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xF2] } 1 -test utf-6.29 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xF8 +test utf-6.29 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xF8] } 1 -test utf-6.30 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2 +test utf-6.30 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2] } 1 -test utf-6.31 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2G +test utf-6.31 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2]G } 1 -test utf-6.32 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0 +test utf-6.32 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0] } 1 -test utf-6.33 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xD0 +test utf-6.33 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xD0] } 1 -test utf-6.34 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xE8 +test utf-6.34 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xE8] } 1 -test utf-6.35 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xF2 +test utf-6.35 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xF2] } 1 -test utf-6.36 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xF8 +test utf-6.36 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xF8] } 1 -test utf-6.37 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8 +test utf-6.37 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8] } 1 -test utf-6.38 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8G +test utf-6.38 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8]G } 1 -test utf-6.39 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8\xA0 +test utf-6.39 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8\xA0] } 1 -test utf-6.40 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8\xD0 +test utf-6.40 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8\xD0] } 1 -test utf-6.41 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8\xE8 +test utf-6.41 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8\xE8] } 1 -test utf-6.42 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8\xF2 +test utf-6.42 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8\xF2] } 1 -test utf-6.43 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF8\xF8 +test utf-6.43 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF8\xF8] } 1 -test utf-6.44 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0G +test utf-6.44 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0]G } 2 -test utf-6.45 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0\xA0 +test utf-6.45 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0\xA0] } 2 -test utf-6.46 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0\xD0 +test utf-6.46 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0\xD0] } 2 -test utf-6.47 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0\xE8 +test utf-6.47 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0\xE8] } 2 -test utf-6.48 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0\xF2 +test utf-6.48 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0\xF2] } 2 -test utf-6.49 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xD0\xA0\xF8 +test utf-6.49 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xD0\xA0\xF8] } 2 -test utf-6.50 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0G +test utf-6.50 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xA0]G } 1 test utf-6.51 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0 + testutfnext \u8820 } 3 -test utf-6.52 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xD0 +test utf-6.52 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xA0\xD0] } 1 -test utf-6.53 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xE8 +test utf-6.53 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xA0\xE8] } 1 -test utf-6.54 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xF2 +test utf-6.54 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xA0\xF2] } 1 -test utf-6.55 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xF8 +test utf-6.55 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xE8\xA0\xF8] } 1 -test utf-6.56 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0G +test utf-6.56 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0]G } 1 -test utf-6.57 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xA0\x00 +test utf-6.57 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xA0\x00] } 1 -test utf-6.58 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xD0 +test utf-6.58 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xD0] } 1 -test utf-6.59 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xE8 +test utf-6.59 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xE8] } 1 -test utf-6.60 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xF2 +test utf-6.60 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xF2] } 1 -test utf-6.61 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xF8 +test utf-6.61 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xF8] } 1 test utf-6.62 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0G + testutfnext \u8820G } 3 -test utf-6.63 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0\xA0 +test utf-6.63 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext \u8820[testbytestring \xA0] } 3 -test utf-6.64 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0\xD0 +test utf-6.64 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext \u8820[testbytestring \xD0] } 3 -test utf-6.65 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0\xE8 +test utf-6.65 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext \u8820[testbytestring \xE8] } 3 -test utf-6.66 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0\xF2 +test utf-6.66 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext \u8820[testbytestring \xF2] } 3 -test utf-6.67 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xE8\xA0\xA0\xF8 +test utf-6.67 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext \u8820[testbytestring \xF8] } 3 -test utf-6.68 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xA0G +test utf-6.68 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xA0]G } 1 test utf-6.69.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0 + testutfnext [testbytestring \xF2\xA0\xA0\xA0] } 4 test utf-6.69.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0 + testutfnext [testbytestring \xF2\xA0\xA0\xA0] } 4 -test utf-6.70 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xA0\xD0 +test utf-6.70 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xA0\xD0] } 1 -test utf-6.71 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xA0\xE8 +test utf-6.71 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xA0\xE8] } 1 -test utf-6.72 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xA0\xF2 +test utf-6.72 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xA0\xF2] } 1 -test utf-6.73 {Tcl_UtfNext} testutfnext { - testutfnext -bytestring \xF2\xA0\xA0\xF8 +test utf-6.73 {Tcl_UtfNext} {testutfnext testbytestring} { + testutfnext [testbytestring \xF2\xA0\xA0\xF8] } 1 test utf-6.74.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0G + testutfnext [testbytestring \xF2\xA0\xA0\xA0]G } 4 test utf-6.74.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0G + testutfnext [testbytestring \xF2\xA0\xA0\xA0]G } 4 test utf-6.75.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xA0 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xA0] } 4 test utf-6.75.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xA0 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xA0] } 4 test utf-6.76.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xD0 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xD0] } 4 test utf-6.76.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xD0 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xD0] } 4 test utf-6.77.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xE8 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xE8] } 4 test utf-6.77.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xE8 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xE8] } 4 test utf-6.78.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xF2 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xF2] } 4 test utf-6.78.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0\xF2 + testutfnext [testbytestring \xF2\xA0\xA0\xA0\xF2] } 4 test utf-6.79.0 {Tcl_UtfNext} {testutfnext tip389} { - testutfnext -bytestring \xF2\xA0\xA0\xA0G\xF8 + testutfnext [testbytestring \xF2\xA0\xA0\xA0G\xF8] } 4 test utf-6.79.1 {Tcl_UtfNext} {testutfnext ucs4} { - testutfnext -bytestring \xF2\xA0\xA0\xA0G\xF8 + testutfnext [testbytestring \xF2\xA0\xA0\xA0G\xF8] } 4 -test utf-6.80 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xC0\x80 +test utf-6.80 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xC0\x80] } 2 -test utf-6.81 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xC0\x81 +test utf-6.81 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xC0\x81] } 1 -test utf-6.82 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xC1\x80 +test utf-6.82 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xC1\x80] } 1 -test utf-6.83 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xC2\x80 +test utf-6.83 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xC2\x80] } 2 -test utf-6.84 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xE0\x80\x80 +test utf-6.84 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xE0\x80\x80] } 1 -test utf-6.85 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xE0\xA0\x80 +test utf-6.85 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xE0\xA0\x80] } 3 -test utf-6.86 {Tcl_UtfNext - overlong sequences} testutfnext { - testutfnext -bytestring \xF0\x80\x80\x80 +test utf-6.86 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { + testutfnext [testbytestring \xF0\x80\x80\x80] } 1 test utf-6.87.0 {Tcl_UtfNext - overlong sequences} {testutfnext tip389} { - testutfnext -bytestring \xF0\x90\x80\x80 + testutfnext [testbytestring \xF0\x90\x80\x80] } 4 test utf-6.87.1 {Tcl_UtfNext - overlong sequences} {testutfnext ucs4} { - testutfnext -bytestring \xF0\x90\x80\x80 + testutfnext [testbytestring \xF0\x90\x80\x80] } 4 -test utf-6.88 {Tcl_UtfNext, pointing to 2th byte of 3-byte valid sequence} testutfnext { - testutfnext -bytestring \xA0\xA0\x00 +test utf-6.88 {Tcl_UtfNext, pointing to 2th byte of 3-byte valid sequence} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xA0\x00] } 2 -test utf-6.89 {Tcl_UtfNext, pointing to 2th byte of 3-byte invalid sequence} testutfnext { - testutfnext -bytestring \x80\x80\x00 +test utf-6.89 {Tcl_UtfNext, pointing to 2th byte of 3-byte invalid sequence} {testutfnext testbytestring} { + testutfnext [testbytestring \x80\x80\x00] } 2 test utf-6.90.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext tip389} { - testutfnext -bytestring \xF4\x8F\xBF\xBF + testutfnext \uDBFF\uDFFF } 4 test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs4} { - testutfnext -bytestring \xF4\x8F\xBF\xBF + testutfnext \U10FFFF } 4 -test utf-6.91 {Tcl_UtfNext, validity check [493dccc2de]} testutfnext { - testutfnext -bytestring \xF4\x90\x80\x80 +test utf-6.91 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring} { + testutfnext [testbytestring \xF4\x90\x80\x80] } 1 -test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} testutfnext { - testutfnext -bytestring \xA0\xA0\xA0 +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 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} testutfnext { - testutfnext -bytestring \x80\x80\x80 +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 { - testutfnext -bytestring \xA0\xA0\xA0\xA0 +test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} { + testutfnext [testbytestring \xA0\xA0\xA0\xA0] } 3 -test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext { - testutfnext -bytestring \x80\x80\x80\x80 +test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} { + testutfnext [testbytestring \x80\x80\x80\x80] } 3 test utf-7.1 {Tcl_UtfPrev} testutfprev { @@ -512,335 +512,335 @@ test utf-7.2 {Tcl_UtfPrev} testutfprev { test utf-7.3 {Tcl_UtfPrev} testutfprev { testutfprev AA } 1 -test utf-7.4 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8 +test utf-7.4 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8] } 1 -test utf-7.4.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0\xA0\xA0 2 +test utf-7.4.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 2 } 1 -test utf-7.4.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xF8\xA0\xA0 2 +test utf-7.4.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xF8\xA0\xA0] 2 } 1 -test utf-7.5 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF2 +test utf-7.5 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF2] } 1 -test utf-7.5.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF2\xA0\xA0\xA0 2 +test utf-7.5.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 2 } 1 -test utf-7.5.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF2\xF8\xA0\xA0 2 +test utf-7.5.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF2\xF8\xA0\xA0] 2 } 1 -test utf-7.6 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8 +test utf-7.6 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE8] } 1 -test utf-7.6.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0\xA0\xA0 2 +test utf-7.6.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A\u8820[testbytestring \xA0] 2 } 1 -test utf-7.6.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xF8\xA0\xA0 2 +test utf-7.6.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE8\xF8\xA0\xA0] 2 } 1 -test utf-7.7 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0 +test utf-7.7 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0] } 1 -test utf-7.7.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0\xA0\xA0 2 +test utf-7.7.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 2 } 1 -test utf-7.7.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xF8\xA0\xA0 2 +test utf-7.7.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xF8\xA0\xA0] 2 } 1 -test utf-7.8 {Tcl_UtfPrev} testutfprev { - testutfprev A\xA0 +test utf-7.8 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xA0] } 1 -test utf-7.8.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xA0\xA0\xA0\xA0 2 +test utf-7.8.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 2 } 1 -test utf-7.8.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xA0\xF8\xA0\xA0 2 +test utf-7.8.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xA0\xF8\xA0\xA0] 2 } 1 -test utf-7.9 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0 +test utf-7.9 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0] } 2 -test utf-7.9.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0\xA0\xA0 3 +test utf-7.9.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 3 } 2 -test utf-7.9.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0\xF8\xA0 3 +test utf-7.9.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0\xF8\xA0] 3 } 2 -test utf-7.10.0 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xF2\xA0 +test utf-7.10.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0] } 1 -test utf-7.10.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0 +test utf-7.10.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF2\xA0] } 1 -test utf-7.10.2 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xF2\xA0\xA0\xA0 3 +test utf-7.10.2 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 3 } 1 -test utf-7.10.3 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0\xA0\xA0 3 +test utf-7.10.3 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 3 } 1 -test utf-7.10.4 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xF2\xA0\xF8\xA0 3 +test utf-7.10.4 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0\xF8\xA0] 3 } 1 -test utf-7.10.5 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0\xF8\xA0 3 +test utf-7.10.5 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF2\xA0\xF8\xA0] 3 } 1 -test utf-7.11 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0 +test utf-7.11 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE8\xA0] } 1 -test utf-7.11.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0\xA0\xA0 3 +test utf-7.11.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A\u8820[testbytestring \xA0] 3 } 1 -test utf-7.11.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0\xF8\xA0 3 +test utf-7.11.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE8\xA0\xF8\xA0] 3 } 1 -test utf-7.11.3 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0\xF8 3 +test utf-7.11.3 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE8\xA0\xF8] 3 } 1 -test utf-7.12 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0 +test utf-7.12 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xA0] } 1 -test utf-7.12.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0\xA0\xA0 3 +test utf-7.12.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 3 } 1 -test utf-7.12.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0\xF8\xA0 3 +test utf-7.12.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xA0\xF8\xA0] 3 } 1 -test utf-7.13 {Tcl_UtfPrev} testutfprev { - testutfprev A\xA0\xA0 +test utf-7.13 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xA0\xA0] } 2 -test utf-7.13.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xA0\xA0\xA0\xA0 3 +test utf-7.13.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 3 } 2 -test utf-7.13.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xA0\xA0\xF8\xA0 3 +test utf-7.13.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xA0\xA0\xF8\xA0] 3 } 2 -test utf-7.14 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0\xA0 +test utf-7.14 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0\xA0] } 3 -test utf-7.14.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0\xA0\xA0 4 +test utf-7.14.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 4 } 3 -test utf-7.14.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xF8\xA0\xA0\xF8 4 +test utf-7.14.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF8\xA0\xA0\xF8] 4 } 3 -test utf-7.15.0 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xF2\xA0\xA0 +test utf-7.15.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0\xA0] } 1 -test utf-7.15.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0\xA0 +test utf-7.15.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF2\xA0\xA0] } 1 -test utf-7.15.2 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xF2\xA0\xA0\xA0 4 +test utf-7.15.2 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 4 } 1 -test utf-7.15.3 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0\xA0\xA0 4 +test utf-7.15.3 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 4 } 1 -test utf-7.15.4 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xF2\xA0\xA0\xF8 4 +test utf-7.15.4 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0\xA0\xF8] 4 } 1 -test utf-7.15.5 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0\xA0\xF8 4 +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 { - testutfprev A\xE8\xA0\xA0 + testutfprev A\u8820 } 1 -test utf-7.16.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0\xA0\xA0 4 +test utf-7.16.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A\u8820[testbytestring \xA0] 4 } 1 -test utf-7.16.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xE8\xA0\xA0\xF8 4 +test utf-7.16.2 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A\u8820[testbytestring \xF8] 4 } 1 -test utf-7.17 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0\xA0 +test utf-7.17 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xA0\xA0] } 3 -test utf-7.17.1 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0\xA0\xA0 4 +test utf-7.17.1 {Tcl_UtfPrev} {testutfprev testbytestring} { + testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 4 } 3 -test utf-7.17.2 {Tcl_UtfPrev} testutfprev { - testutfprev A\xD0\xA0\xA0\xF8 4 +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 tip389} { - testutfprev A\xA0\xA0\xA0 +test utf-7.18.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xA0\xA0\xA0] } 3 -test utf-7.18.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xA0\xA0\xA0 +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 tip389} { - testutfprev A\xA0\xA0\xA0\xA0 4 +test utf-7.18.2 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 4 } 3 -test utf-7.18.3 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xA0\xA0\xA0\xA0 4 +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 tip389} { - testutfprev A\xA0\xA0\xA0\xF8 4 +test utf-7.18.4 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xA0\xA0\xA0\xF8] 4 } 3 -test utf-7.18.5 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xA0\xA0\xA0\xF8 4 +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 tip389} { - testutfprev A\xF8\xA0\xA0\xA0 +test utf-7.19.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF8\xA0\xA0\xA0] } 4 -test utf-7.19.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF8\xA0\xA0\xA0 +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 tip389} { - testutfprev A\xF2\xA0\xA0\xA0 +test utf-7.20.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF2\xA0\xA0\xA0] } 1 -test utf-7.20.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xF2\xA0\xA0\xA0 +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 tip389} { - testutfprev A\xE8\xA0\xA0\xA0 +test utf-7.21.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A\u8820[testbytestring \xA0] } 4 -test utf-7.21.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xE8\xA0\xA0\xA0 +test utf-7.21.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { + testutfprev A\u8820[testbytestring \xA0] } 4 -test utf-7.22.0 {Tcl_UtfPrev} {testutfprev tip389} { - testutfprev A\xD0\xA0\xA0\xA0 +test utf-7.22.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xD0\xA0\xA0\xA0] } 4 -test utf-7.22.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xD0\xA0\xA0\xA0 +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 tip389} { - testutfprev A\xA0\xA0\xA0\xA0 +test utf-7.23.0 {Tcl_UtfPrev} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xA0\xA0\xA0\xA0] } 4 -test utf-7.23.1 {Tcl_UtfPrev} {testutfprev ucs4} { - testutfprev A\xA0\xA0\xA0\xA0 +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 { - testutfprev A\xC0\x81 +test utf-7.24 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xC0\x81] } 2 -test utf-7.25 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xC0\x81 2 +test utf-7.25 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xC0\x81] 2 } 1 -test utf-7.26 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\x80\x80 +test utf-7.26 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE0\x80\x80] } 3 -test utf-7.27 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\x80 +test utf-7.27 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE0\x80] } 2 -test utf-7.27.1 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\x80\x80 3 +test utf-7.27.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE0\x80\x80] 3 } 2 -test utf-7.28 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0 +test utf-7.28 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE0] } 1 -test utf-7.28.1 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\x80\x80 2 +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 tip389} { - testutfprev A\xF0\x80\x80\x80 +test utf-7.29.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF0\x80\x80\x80] } 4 -test utf-7.29.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { - testutfprev A\xF0\x80\x80\x80 +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 { - testutfprev A\xF0\x80\x80\x80 4 +test utf-7.30 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF0\x80\x80\x80] 4 } 3 -test utf-7.31 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xF0\x80\x80\x80 3 +test utf-7.31 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF0\x80\x80\x80] 3 } 2 -test utf-7.32 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xF0\x80\x80\x80 2 +test utf-7.32 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF0\x80\x80\x80] 2 } 1 -test utf-7.33 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xC0\x80 +test utf-7.33 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xC0\x80] } 1 -test utf-7.34 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xC1\x80 +test utf-7.34 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xC1\x80] } 2 -test utf-7.35 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xC2\x80 +test utf-7.35 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xC2\x80] } 1 -test utf-7.36 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\xA0\x80 +test utf-7.36 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE0\xA0\x80] } 1 -test utf-7.37 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\xA0\x80 3 +test utf-7.37 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xE0\xA0\x80] 3 } 1 -test utf-7.38 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xE0\xA0\x80 2 +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 tip389} { - testutfprev A\xF0\x90\x80\x80 +test utf-7.39.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF0\x90\x80\x80] } 1 -test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { - testutfprev A\xF0\x90\x80\x80 +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 tip389} { - testutfprev A\xF0\x90\x80\x80 4 +test utf-7.40.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF0\x90\x80\x80] 4 } 1 -test utf-7.40.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { - testutfprev A\xF0\x90\x80\x80 4 +test utf-7.40.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF0\x90\x80\x80] 4 } 1 -test utf-7.41.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev tip389} { - testutfprev A\xF0\x90\x80\x80 3 +test utf-7.41.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF0\x90\x80\x80] 3 } 1 -test utf-7.41.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { - testutfprev A\xF0\x90\x80\x80 3 +test utf-7.41.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} { + testutfprev A[testbytestring \xF0\x90\x80\x80] 3 } 1 -test utf-7.42 {Tcl_UtfPrev -- overlong sequence} testutfprev { - testutfprev A\xF0\x90\x80\x80 2 +test utf-7.42 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF0\x90\x80\x80] 2 } 1 -test utf-7.43 {Tcl_UtfPrev -- no lead byte at start} testutfprev { - testutfprev \xA0 +test utf-7.43 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} { + testutfprev [testbytestring \xA0] } 0 -test utf-7.44 {Tcl_UtfPrev -- no lead byte at start} testutfprev { - testutfprev \xA0\xA0 +test utf-7.44 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} { + testutfprev [testbytestring \xA0\xA0] } 1 -test utf-7.45 {Tcl_UtfPrev -- no lead byte at start} testutfprev { - testutfprev \xA0\xA0\xA0 +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 tip389} { - testutfprev \xA0\xA0\xA0\xA0 +test utf-7.46.0 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring tip389} { + testutfprev [testbytestring \xA0\xA0\xA0\xA0] } 3 -test utf-7.46.1 {Tcl_UtfPrev -- no lead byte at start} {testutfprev ucs4} { - testutfprev \xA0\xA0\xA0\xA0 +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 { - testutfprev \xE8\xA0 +test utf-7.47 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} {testutfprev testbytestring} { + testutfprev [testbytestring \xE8\xA0] } 0 -test utf-7.47.1 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} testutfprev { - testutfprev \xE8\xA0\xA0 2 +test utf-7.47.1 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} {testutfprev testbytestring} { + testutfprev \u8820 2 } 0 -test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} testutfprev { - testutfprev \xE8\xA0\x00 2 +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 tip389} { - testutfprev A\xF4\x8F\xBF\xBF +test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring tip389} { + testutfprev A\uDBFF\uDFFF } 1 -test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { - testutfprev A\xF4\x8F\xBF\xBF +test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} { + testutfprev A\U10FFFF } 1 -test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev tip389} { - testutfprev A\xF4\x8F\xBF\xBF 4 +test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring tip389} { + testutfprev A\uDBFF\uDFFF 4 } 1 -test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { - testutfprev A\xF4\x8F\xBF\xBF 4 +test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} { + testutfprev A\U10FFFF 4 } 1 -test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev tip389} { - testutfprev A\xF4\x8F\xBF\xBF 3 +test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring tip389} { + testutfprev A\uDBFF\uDFFF 3 } 1 -test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { - testutfprev A\xF4\x8F\xBF\xBF 3 +test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} { + testutfprev A\U10FFFF 3 } 1 -test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { - testutfprev A\xF4\x8F\xBF\xBF 2 +test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { + testutfprev A\U10FFFF 2 } 1 -test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev tip389} { - testutfprev A\xF4\x90\x80\x80 +test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring tip389} { + testutfprev A[testbytestring \xF4\x90\x80\x80] } 4 -test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { - testutfprev A\xF4\x90\x80\x80 +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 { - testutfprev A\xF4\x90\x80\x80 4 +test utf-7.49.2 {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 { - testutfprev A\xF4\x90\x80\x80 3 +test utf-7.49.3 {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 { - testutfprev A\xF4\x90\x80\x80 2 +test utf-7.49.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { + testutfprev A[testbytestring \xF4\x90\x80\x80] 2 } 1 test utf-8.1 {Tcl_UniCharAtIndex: index = 0} { @@ -988,10 +988,10 @@ test utf-10.1 {Tcl_UtfBackslash: dst == NULL} { } { } test utf-10.2 {Tcl_UtfBackslash: \u subst} testbytestring { - expr {"\uA2" eq [testbytestring "\xC2\xA2"]} + expr {"\uA2" eq [testbytestring \xC2\xA2]} } 1 test utf-10.3 {Tcl_UtfBackslash: longer \u subst} testbytestring { - expr {"\u4E21" eq [testbytestring "\xE4\xB8\xA1"]} + expr {"\u4E21" eq [testbytestring \xE4\xB8\xA1]} } 1 test utf-10.4 {Tcl_UtfBackslash: stops at first non-hex} testbytestring { expr {"\u4E2k" eq "[testbytestring \xD3\xA2]k"} -- cgit v0.12 From 87969cfb0ee1d53c7034f96f34cc443c7878c36c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 May 2020 14:53:58 +0000 Subject: Never mind remark about TIP #573 in previous commit: Test failure was due to typo. Fixed now. --- generic/tclEncoding.c | 2 +- tests/encoding.test | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 444f99e..ae02821 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2367,7 +2367,7 @@ UtfToUtfProc( /* A surrogate character is detected, handle especially */ int low = *chPtr; size_t len = (src <= srcEnd-3) ? TclUtfToUCS4(src, &low) : 0; - if (((low & ~0x3FF) != 0xC00) || (*chPtr & 0x400)) { + if (((low & ~0x3FF) != 0xDC00) || (*chPtr & 0x400)) { *dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF); *dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF); *dst++ = (char) ((*chPtr | 0x80) & 0xBF); diff --git a/tests/encoding.test b/tests/encoding.test index 04692b7..e313a29 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -36,7 +36,6 @@ proc runtests {} { testConstraint testencoding [llength [info commands testencoding]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint teststringbytes [llength [info commands teststringbytes]] -testConstraint ucs2 [expr {[format %c 0x010000] eq "\uFFFD"}] testConstraint exec [llength [info commands exec]] testConstraint testgetencpath [llength [info commands testgetencpath]] @@ -322,7 +321,7 @@ test encoding-15.3 {UtfToUtfProc null character input} teststringbytes { binary scan [teststringbytes $y] H* z set z } c080 -test encoding-15.4 {UtfToUtfProc emoji character input} -constraints ucs2 -body { +test encoding-15.4 {UtfToUtfProc emoji character input} -body { set x \xED\xA0\xBD\xED\xB8\x82 set y [encoding convertfrom utf-8 \xED\xA0\xBD\xED\xB8\x82] list [string length $x] $y -- cgit v0.12 From a2f768dce66fc3f48b9a095fdc121fc9cc20b23a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 5 May 2020 11:44:32 +0000 Subject: Fix Tcl_UtfPrev() such that it can never go back more than TCL_UTF_MAX bytes. Already done correctly on core-8-6-branch, but this was never forwarded to core-8-branch. --- generic/tclUtf.c | 10 +++++++--- tests/utf.test | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 782657a..7b6ec63 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -815,13 +815,13 @@ Tcl_NumUtfChars( } if (i < 0) i = INT_MAX; /* Bug [2738427] */ } else { - const char *endPtr = src + length - 4; + const char *endPtr = src + length - TCL_UTF_MAX; while (src < endPtr) { src += TclUtfToUniChar(src, &ch); i++; } - endPtr += 4; + endPtr += TCL_UTF_MAX; while ((src < endPtr) && Tcl_UtfCharComplete(src, endPtr - src)) { src += TclUtfToUniChar(src, &ch); i++; @@ -1065,7 +1065,7 @@ Tcl_UtfPrev( /* Continue the search backwards... */ look--; - } while (trailBytesSeen < 4); + } while (trailBytesSeen < TCL_UTF_MAX); /* * We've seen TCL_UTF_MAX trail bytes, so we know there will not be a @@ -1073,7 +1073,11 @@ Tcl_UtfPrev( * accepting the fallback (for TCL_UTF_MAX > 3) or just go back as * far as we can. */ +#if TCL_UTF_MAX > 3 return fallback; +#else + return src - TCL_UTF_MAX; +#endif } /* diff --git a/tests/utf.test b/tests/utf.test index 7079bbf..ae50b0e 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -661,49 +661,49 @@ test utf-7.17.2 {Tcl_UtfPrev} {testutfprev testbytestring} { } 3 test utf-7.18.0 {Tcl_UtfPrev} {testutfprev testbytestring utf16} { testutfprev A[testbytestring \xA0\xA0\xA0] -} 3 +} 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 utf16} { testutfprev A[testbytestring \xA0\xA0\xA0\xA0] 4 -} 3 +} 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 utf16} { testutfprev A[testbytestring \xA0\xA0\xA0\xF8] 4 -} 3 +} 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 utf16} { testutfprev A[testbytestring \xF8\xA0\xA0\xA0] -} 4 +} 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 utf16} { testutfprev A[testbytestring \xF2\xA0\xA0\xA0] -} 1 +} 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 utf16} { testutfprev A\u8820[testbytestring \xA0] -} 4 +} 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 utf16} { testutfprev A[testbytestring \xD0\xA0\xA0\xA0] -} 4 +} 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 utf16} { testutfprev A[testbytestring \xA0\xA0\xA0\xA0] -} 4 +} 2 test utf-7.23.1 {Tcl_UtfPrev} {testutfprev testbytestring ucs4} { testutfprev A[testbytestring \xA0\xA0\xA0\xA0] } 4 @@ -730,7 +730,7 @@ test utf-7.28.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} } 1 test utf-7.29.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring utf16} { testutfprev A[testbytestring \xF0\x80\x80\x80] -} 4 +} 2 test utf-7.29.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} { testutfprev A[testbytestring \xF0\x80\x80\x80] } 4 @@ -763,7 +763,7 @@ test utf-7.38 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { } 1 test utf-7.39.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring utf16} { testutfprev A[testbytestring \xF0\x90\x80\x80] -} 1 +} 2 test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring ucs4} { testutfprev A[testbytestring \xF0\x90\x80\x80] } 1 @@ -793,7 +793,7 @@ test utf-7.45 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestrin } 2 test utf-7.46.0 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring utf16} { testutfprev [testbytestring \xA0\xA0\xA0\xA0] -} 3 +} 1 test utf-7.46.1 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring ucs4} { testutfprev [testbytestring \xA0\xA0\xA0\xA0] } 3 @@ -808,7 +808,7 @@ test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} { } 0 test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring utf16} { testutfprev A\uDBFF\uDFFF -} 1 +} 2 test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} { testutfprev A\U10FFFF } 1 @@ -829,7 +829,7 @@ test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbyte } 1 test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring utf16} { testutfprev A[testbytestring \xF4\x90\x80\x80] -} 4 +} 2 test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring ucs4} { testutfprev A[testbytestring \xF4\x90\x80\x80] } 4 -- cgit v0.12 From dfc1625fc35649fafff8a6619598351d21ef8bb9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 5 May 2020 16:23:56 +0000 Subject: Remove PROTO_FLAGS here too --- unix/Makefile.in | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 6654f25..08219ca 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -114,11 +114,6 @@ LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@ -# To disable ANSI-C procedure prototypes reverse the comment characters on the -# following lines: -PROTO_FLAGS = -#PROTO_FLAGS = -DNO_PROTOTYPE - # If you use the setenv, putenv, or unsetenv procedures to modify environment # variables in your application and you'd like those modifications to appear # in the "env" Tcl variable, switch the comments on the two lines below so @@ -282,7 +277,7 @@ VALGRINDARGS = --tool=memcheck --num-callers=24 \ STUB_CC_SWITCHES = -I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \ ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ - ${AC_FLAGS} ${PROTO_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} \ + ${AC_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} \ @EXTRA_CC_SWITCHES@ CC_SWITCHES = $(STUB_CC_SWITCHES) ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS -DMP_NO_STDINT @@ -292,7 +287,7 @@ APP_CC_SWITCHES = $(CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@ LIBS = @TCL_LIBS@ DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \ - ${AC_FLAGS} ${PROTO_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ + ${AC_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ TCLSH_OBJS = tclAppInit.o -- cgit v0.12 From 74330f28739f9f3c3020e7245ccf6710251534ae Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 May 2020 11:17:26 +0000 Subject: Fix [fad64a857e76f98e]: "lsearch" provides wrong errorCode with bad -stride option --- generic/tclCmdIL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 3241398..7938088 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -3305,7 +3305,7 @@ Tcl_LsearchObjCmd( if (groupSize < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "stride length must be at least 1", -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", "BADSTRIDE", NULL); result = TCL_ERROR; goto done; -- cgit v0.12 From 594b85ce18c43c1a0665f90f702fa3d0da4659cf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 10 May 2020 20:58:10 +0000 Subject: Demonstration for documentation bug, and suggestion for improved wording. More explanation will follow in the ticket. --- doc/Utf.3 | 4 +++- generic/tclUtf.c | 12 +----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/doc/Utf.3 b/doc/Utf.3 index c8c6132..35f9327 100644 --- a/doc/Utf.3 +++ b/doc/Utf.3 @@ -290,7 +290,9 @@ characters. Behavior is undefined if a negative \fIindex\fR is given. \fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must contain at least \fIindex\fR characters. This is equivalent to calling -\fBTcl_UtfNext\fR \fIindex\fR times. If a negative \fIindex\fR is given, +\fBTcl_UtfToUniChar\fR \fIindex\fR times, except if the index points to +a lower surrogate preceded by an upper surrogate: In that case, the returned +pointer will point just after the lower surrogate. If a negative \fIindex\fR is given, the return pointer points to the first character in the source string. .PP \fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 5951f68..dbcfd6d 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -1166,19 +1166,9 @@ Tcl_UtfAtIndex( const char *src, /* The UTF-8 string. */ int index) /* The position of the desired character. */ { - Tcl_UniChar ch = 0; - int len = 0; - while (index-- > 0) { - len = TclUtfToUniChar(src, &ch); - src += len; + src = Tcl_UtfNext(src); } -#if TCL_UTF_MAX <= 3 - if ((ch >= 0xD800) && (len < 3)) { - /* Index points at character following high Surrogate */ - src += TclUtfToUniChar(src, &ch); - } -#endif return src; } -- cgit v0.12