diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-02 21:54:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-02 21:54:14 (GMT) |
commit | 797bc84ed2bc1f24a8adc1e42a91ef90d2c0c91f (patch) | |
tree | 97492f28220d9ff85959c486af12613c9588ffa4 /tests/utf.test | |
parent | cc90266615cb98853ebc61301119d1f7a3718d7a (diff) | |
download | tcl-797bc84ed2bc1f24a8adc1e42a91ef90d2c0c91f.zip tcl-797bc84ed2bc1f24a8adc1e42a91ef90d2c0c91f.tar.gz tcl-797bc84ed2bc1f24a8adc1e42a91ef90d2c0c91f.tar.bz2 |
Seems almost correct. Still problem with "string index" for TCL_UTF_MAX>3
Diffstat (limited to 'tests/utf.test')
-rw-r--r-- | tests/utf.test | 115 |
1 files changed, 56 insertions, 59 deletions
diff --git a/tests/utf.test b/tests/utf.test index 50351cb..71b4978 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -398,7 +398,7 @@ test utf-6.68 {Tcl_UtfNext} testutfnext { test utf-6.69.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0 } 1 -test utf-6.69.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.69.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0 } 4 test utf-6.70 {Tcl_UtfNext} testutfnext { @@ -416,37 +416,37 @@ test utf-6.73 {Tcl_UtfNext} testutfnext { test utf-6.74.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G } 1 -test utf-6.74.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.74.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0G } 4 test utf-6.75.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 } 1 -test utf-6.75.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.75.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xA0 } 4 test utf-6.76.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xD0 } 1 -test utf-6.76.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.76.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xD0 } 4 test utf-6.77.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xE8 } 1 -test utf-6.77.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.77.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xE8 } 4 test utf-6.78.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xF2 } 1 -test utf-6.78.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.78.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xF2 } 4 test utf-6.79.0 {Tcl_UtfNext} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G\xF8 } 1 -test utf-6.79.1 {Tcl_UtfNext} {testutfnext fullutf} { +test utf-6.79.1 {Tcl_UtfNext} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0G\xF8 } 4 test utf-6.80 {Tcl_UtfNext - overlong sequences} testutfnext { @@ -473,7 +473,7 @@ test utf-6.86 {Tcl_UtfNext - overlong sequences} testutfnext { test utf-6.87.0 {Tcl_UtfNext - overlong sequences} {testutfnext ucs2} { testutfnext \xF0\x90\x80\x80 } 1 -test utf-6.87.1 {Tcl_UtfNext - overlong sequences} {testutfnext fullutf} { +test utf-6.87.1 {Tcl_UtfNext - overlong sequences} {testutfnext ucs4} { testutfnext \xF0\x90\x80\x80 } 4 test utf-6.88 {Tcl_UtfNext, pointing to 2th byte of 3-byte valid sequence} testutfnext { @@ -485,7 +485,7 @@ test utf-6.89 {Tcl_UtfNext, pointing to 2th byte of 3-byte invalid sequence} tes test utf-6.90.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs2} { testutfnext \xF4\x8F\xBF\xBF } 1 -test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} { +test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs4} { testutfnext \xF4\x8F\xBF\xBF } 4 test utf-6.91.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs2} { @@ -497,12 +497,9 @@ test utf-6.91.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} testutfnext { testutfnext \xA0\xA0\xA0 } 1 -test utf-6.93.0 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext ucs2} { +test utf-6.93 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} testutfnext { testutfnext \x80\x80\x80 } 1 -test utf-6.93.1 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext fullutf} { - testutfnext \x80\x80\x80 -} 3 test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext { testutfnext \xA0\xA0\xA0\xA0 } 1 @@ -554,64 +551,64 @@ test utf-6.109 {Tcl_UtfNext, read limits} testutfnext { test utf-6.110.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 1 } 1 -test utf-6.110.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.110.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0G 1 } 0 test utf-6.111.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 2 } 1 -test utf-6.111.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.111.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0G 2 } 0 test utf-6.112.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 3 } 1 -test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0G 3 } 0 test utf-6.113.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 4 } 1 -test utf-6.113.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.113.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0G 4 } 4 test utf-6.114.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 1 } 1 -test utf-6.114.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.114.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xA0 1 } 0 test utf-6.115.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 2 } 1 -test utf-6.115.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.115.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xA0 2 } 0 test utf-6.116.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 3 } 1 -test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xA0 3 } 0 test utf-6.117.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 4 } 1 -test utf-6.117.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.117.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} { testutfnext \xF2\xA0\xA0\xA0\xA0 4 } 4 test utf-6.118 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0G 0 } 0 -test utf-6.119 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.119 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xA0G 1 } 0 -test utf-6.120 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.120 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xA0\xA0 1 } 0 -test utf-6.121 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.121 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xA0\xA0G 2 } 0 -test utf-6.122 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.122 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xA0\xA0\xA0 2 } 0 test utf-6.123 {Tcl_UtfNext, read limits} testutfnext { @@ -693,19 +690,19 @@ test utf-7.9.2 {Tcl_UtfPrev} testutfprev { test utf-7.10.0 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0 } 2 -test utf-7.10.1 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.10.1 {Tcl_UtfPrev} {testutfprev ucs4} { testutfprev A\xF2\xA0 } 1 test utf-7.10.2 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xA0\xA0 3 } 2 -test utf-7.10.3 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.10.3 {Tcl_UtfPrev} {testutfprev ucs4} { testutfprev A\xF2\xA0\xA0\xA0 3 } 1 test utf-7.10.4 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xF8\xA0 3 } 2 -test utf-7.10.5 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.10.5 {Tcl_UtfPrev} {testutfprev ucs4} { testutfprev A\xF2\xA0\xF8\xA0 3 } 1 test utf-7.11 {Tcl_UtfPrev} testutfprev { @@ -750,19 +747,19 @@ test utf-7.14.2 {Tcl_UtfPrev} testutfprev { test utf-7.15.0 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xA0 } 3 -test utf-7.15.1 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.15.1 {Tcl_UtfPrev} {testutfprev ucs4} { testutfprev A\xF2\xA0\xA0 } 1 test utf-7.15.1.0 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xA0\xA0 4 } 3 -test utf-7.15.1.1 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.15.1.1 {Tcl_UtfPrev} {testutfprev ucs4} { testutfprev A\xF2\xA0\xA0\xA0 4 } 1 test utf-7.15.2.0 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xA0\xF8 4 } 3 -test utf-7.15.2.1 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.15.2.1 {Tcl_UtfPrev} {testutfprev ucs4} { testutfprev A\xF2\xA0\xA0\xF8 4 } 1 test utf-7.16 {Tcl_UtfPrev} testutfprev { @@ -888,19 +885,19 @@ test utf-7.38 {Tcl_UtfPrev -- overlong sequence} testutfprev { test utf-7.39.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs2} { testutfprev A\xF0\x90\x80\x80 } 2 -test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev fullutf} { +test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { testutfprev A\xF0\x90\x80\x80 } 1 test utf-7.40.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs2} { testutfprev A\xF0\x90\x80\x80 4 } 3 -test utf-7.40.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev fullutf} { +test utf-7.40.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { testutfprev A\xF0\x90\x80\x80 4 } 1 test utf-7.41.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs2} { testutfprev A\xF0\x90\x80\x80 3 } 2 -test utf-7.41.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev fullutf} { +test utf-7.41.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs4} { testutfprev A\xF0\x90\x80\x80 3 } 1 test utf-7.42 {Tcl_UtfPrev -- overlong sequence} testutfprev { @@ -933,19 +930,19 @@ test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} t test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { testutfprev A\xF4\x8F\xBF\xBF } 2 -test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { +test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { testutfprev A\xF4\x8F\xBF\xBF } 1 test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { testutfprev A\xF4\x8F\xBF\xBF 4 } 3 -test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { +test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { testutfprev A\xF4\x8F\xBF\xBF 4 } 1 test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { testutfprev A\xF4\x8F\xBF\xBF 3 } 2 -test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { +test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} { testutfprev A\xF4\x8F\xBF\xBF 3 } 1 test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { @@ -978,37 +975,37 @@ test utf-8.1 {Tcl_UniCharAtIndex: index = 0} { } a test utf-8.2 {Tcl_UniCharAtIndex: index = 0} { string index \u4E4E\u25A 0 -} "\u4E4E" +} \u4E4E test utf-8.3 {Tcl_UniCharAtIndex: index > 0} { string index abcd 2 } c test utf-8.4 {Tcl_UniCharAtIndex: index > 0} { string index \u4E4E\u25A\xFF\u543 2 -} "\uFF" +} \uFF test utf-8.5.0 {Tcl_UniCharAtIndex: high surrogate} ucs2 { string index \uD842 0 -} "\uD842" -test utf-8.5.1 {Tcl_UniCharAtIndex: high surrogate} ucs4 { - string index \uD842 0 -} "\uD842" +} \uD842 +test utf-8.5.1 {Tcl_UniCharAtIndex: high surrogate} {teststringbytes ucs4} { + teststringbytes [string index \uD842 0] +} \xF0 test utf-8.5.2 {Tcl_UniCharAtIndex: high surrogate} {teststringbytes tip389} { teststringbytes [string index \uD842 0] } \xF0 test utf-8.6 {Tcl_UniCharAtIndex: low surrogate} { string index \uDC42 0 -} "\uDC42" +} \uDC42 test utf-8.7.0 {Tcl_UniCharAtIndex: Emoji} ucs2 { string index \uD83D\uDE00G 0 -} "\uD83D" +} \uD83D test utf-8.7.1 {Tcl_UniCharAtIndex: Emoji} ucs4 { string index \uD83D\uDE00G 0 -} "\U1F600" +} \U1F600 test utf-8.7.2 {Tcl_UniCharAtIndex: Emoji} {teststringbytes tip389} { teststringbytes [string index \uD83D\uDE00G 0] } \xF0 test utf-8.8.0 {Tcl_UniCharAtIndex: Emoji} ucs2 { string index \uD83D\uDE00G 1 -} "\uDE00" +} \uDE00 test utf-8.8.1 {Tcl_UniCharAtIndex: Emoji} ucs4 { string index \uD83D\uDE00G 1 } G @@ -1026,10 +1023,10 @@ test utf-8.9.2 {Tcl_UniCharAtIndex: Emoji} tip389 { } G test utf-8.10.0 {Tcl_UniCharAtIndex: Emoji} {Uesc ucs2} { string index \U1F600G 0 -} "\uFFFD" +} \uFFFD test utf-8.10.1 {Tcl_UniCharAtIndex: Emoji} {Uesc ucs4} { string index \U1F600G 0 -} "\U1F600" +} \U1F600 test utf-8.10.2 {Tcl_UniCharAtIndex: Emoji} {Uesc teststringbytes tip389} { teststringbytes [string index \U1F600G 0] } \xF0 @@ -1057,22 +1054,22 @@ test utf-9.1 {Tcl_UtfAtIndex: index = 0} { } abc test utf-9.2 {Tcl_UtfAtIndex: index > 0} { string range \u4E4E\u25A\xFF\u543klmnop 1 5 -} "\u25A\xFF\u543kl" +} \u25A\xFF\u543kl test utf-9.3.0 {Tcl_UtfAtIndex: index = 0, Emoji} ucs2 { string range \uD83D\uDE00G 0 0 -} "\uD83D" +} \uD83D test utf-9.3.1 {Tcl_UtfAtIndex: index = 0, Emoji} ucs4 { string range \uD83D\uDE00G 0 0 -} "\U1F600" +} \U1F600 test utf-9.3.2 {Tcl_UtfAtIndex: index = 0, Emoji} tip389 { string range \uD83D\uDE00G 0 0 -} "\U1F600" +} \U1F600 test utf-9.4.0 {Tcl_UtfAtIndex: index > 0, Emoji} ucs2 { string range \uD83D\uDE00G 1 1 -} "\uDE00" +} \uDE00 test utf-9.4.1 {Tcl_UtfAtIndex: index > 0, Emoji} ucs4 { string range \uD83D\uDE00G 1 1 -} "G" +} G test utf-9.4.2 {Tcl_UtfAtIndex: index > 0, Emoji} tip389 { string range \uD83D\uDE00G 1 1 } {} @@ -1087,19 +1084,19 @@ test utf-9.5.2 {Tcl_UtfAtIndex: index > 0, Emoji} tip389 { } G test utf-9.6.0 {Tcl_UtfAtIndex: index = 0, Emoji} {Uesc ucs2} { string range \U1f600G 0 0 -} "\uFFFD" +} \uFFFD test utf-9.6.1 {Tcl_UtfAtIndex: index = 0, Emoji} {Uesc ucs4} { string range \U1f600G 0 0 -} "\U1F600" +} \U1F600 test utf-9.6.2 {Tcl_UtfAtIndex: index = 0, Emoji} {Uesc tip389} { string range \U1f600G 0 0 -} "\U1F600" +} \U1F600 test utf-9.7.0 {Tcl_UtfAtIndex: index > 0, Emoji} {Uesc ucs2} { string range \U1f600G 1 1 } G test utf-9.7.1 {Tcl_UtfAtIndex: index > 0, Emoji} {Uesc ucs4} { string range \U1f600G 1 1 -} "G" +} G test utf-9.7.2 {Tcl_UtfAtIndex: index > 0, Emoji} {Uesc tip389} { string range \U1f600G 1 1 } {} |