diff options
| -rw-r--r-- | tests/string.test | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/tests/string.test b/tests/string.test index 781c0bc..223251e 100644 --- a/tests/string.test +++ b/tests/string.test @@ -32,6 +32,7 @@ testConstraint testobj [expr {[info commands testobj] ne {}}] testConstraint testindexobj [expr {[info commands testindexobj] ne {}}] testConstraint testevalex [expr {[info commands testevalex] ne {}}] testConstraint tip389 [expr {[string length \U010000] == 2}] +testConstraint testbytestring [llength [info commands testbytestring]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] @@ -1813,33 +1814,33 @@ test string-20.5.$noComp {string trimright} { test string-20.6.$noComp {string trimright, unicode default} { run {string trimright ABC\u1361\x85\x00\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000} } ABC\u1361 -test string-20.7 {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} knownBug { +test string-20.7.$noComp {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} {testbytestring knownBug} { set result {} - set a [testbytestring \xc0\x80\x88] + set a [testbytestring \xC0\x80\x88] set b foo$a - set m [list \u0000 U \x88 V [testbytestring \x88] W] + set m [list \x00 U \x88 V [testbytestring \x88] W] lappend result [string map $m $b] - lappend result [string map $m [string trimright $b x]] - lappend result [string map $m [string trimright $b \u0000]] - lappend result [string map $m [string trimleft $b fox]] - lappend result [string map $m [string trimleft $b fo\u0000]] - lappend result [string map $m [string trim $b fox]] - lappend result [string map $m [string trim $b fo\u0000]] + lappend result [string map $m [run {string trimright $b x}]] + lappend result [string map $m [run {string trimright $b \x00}]] + lappend result [string map $m [run {string trimleft $b fox}]] + lappend result [string map $m [run {string trimleft $b fo\x00}]] + lappend result [string map $m [run {string trim $b fox}]] + lappend result [string map $m [run {string trim $b fo\x00}]] } [list {*}[lrepeat 3 fooUV] {*}[lrepeat 2 UV V]] -test string-20.8 {[c61818e4c9] [string trimright] fails when UtfPrev is ok} knownBug { +test string-20.8 {[c61818e4c9] [string trimright] fails when UtfPrev is ok} {testbytestring knownBug} { set result {} set a [testbytestring \xE8\x80] set b foo$a set m [list \xE8 U \x80 V [testbytestring \xE8] W [testbytestring \x80] X]] lappend result [string map $m $b] - lappend result [string map $m [string trimright $b x]] - lappend result [string map $m [string trimright $b \xE8]] - lappend result [string map $m [string trimright $b [testbytestring \xE8]]] - lappend result [string map $m [string trimright $b \x80]] - lappend result [string map $m [string trimright $b [testbytestring \x80]]] - lappend result [string map $m [string trimright $b \xE8\x80]] - lappend result [string map $m [string trimright $b [testbytestring \xE8\x80]]] - lappend result [string map $m [string trimright $b \u0000]] + lappend result [string map $m [run {string trimright $b x}]] + lappend result [string map $m [run {string trimright $b \xE8}]] + lappend result [string map $m [run {string trimright $b [testbytestring \xE8]}]] + lappend result [string map $m [run {string trimright $b \x80}]] + lappend result [string map $m [run {string trimright $b [testbytestring \x80]}]] + lappend result [string map $m [run {string trimright $b \xE8\x80}]] + lappend result [string map $m [run {string trimright $b [testbytestring \xE8\x80]}]] + lappend result [string map $m [run {string trimright $b \u0000}]] } [list {*}[lrepeat 4 fooUV] {*}[lrepeat 2 fooU] {*}[lrepeat 2 foo] fooUV] test string-21.1.$noComp {string wordend} -body { |
