diff options
| author | dgp <dgp@users.sourceforge.net> | 2020-04-13 01:41:23 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2020-04-13 01:41:23 (GMT) |
| commit | a7989b0e58febbaf59a73a11cca96881dc525b18 (patch) | |
| tree | 7242251744fbe5df692102a428328c3b8ac1a719 | |
| parent | 7f8fe108012f68812e8044f907350e0fd9b09e88 (diff) | |
| parent | a8641c2da18720d07e3a0235703a9587b46d12ca (diff) | |
| download | tcl-a7989b0e58febbaf59a73a11cca96881dc525b18.zip tcl-a7989b0e58febbaf59a73a11cca96881dc525b18.tar.gz tcl-a7989b0e58febbaf59a73a11cca96881dc525b18.tar.bz2 | |
merge 8.5
| -rw-r--r-- | tests/string.test | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/string.test b/tests/string.test index f6eaaf0..05a0623 100644 --- a/tests/string.test +++ b/tests/string.test @@ -1459,13 +1459,11 @@ test string-20.4 {string trimright} { test string-20.5 {string trimright} { string trimright "" } {} -test string-20.6 {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} -setup { - interp alias {} bytes {} encoding convertfrom identity -} -body { +test string-20.6 {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} { set result {} - set a [bytes \xc0\x80\x88] + set a [bytestring \xc0\x80\x88] set b foo$a - set m [list \u0000 U \x88 V [bytes \x88] W] + set m [list \u0000 U \x88 V [bytestring \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]] @@ -1473,9 +1471,22 @@ test string-20.6 {string trim on not valid utf-8 sequence (consider NTS as conti 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]] -} -result [list {*}[lrepeat 3 fooUV] {*}[lrepeat 2 UV V]] -cleanup { - interp alias {} bytes {} -} +} [list {*}[lrepeat 3 fooUV] {*}[lrepeat 2 UV V]] +test string-20.7 {[c61818e4c9] [string trimright] fails when UtfPrev is ok} { + set result {} + set a [bytestring \xE8\x80] + set b foo$a + set m [list \xE8 U \x80 V [bytestring \xE8] W [bytestring \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 [bytestring \xE8]]] + lappend result [string map $m [string trimright $b \x80]] + lappend result [string map $m [string trimright $b [bytestring \x80]]] + lappend result [string map $m [string trimright $b \xE8\x80]] + lappend result [string map $m [string trimright $b [bytestring \xE8\x80]]] + lappend result [string map $m [string trimright $b \u0000]] +} [list {*}[lrepeat 4 fooUV] {*}[lrepeat 2 fooU] {*}[lrepeat 2 foo] fooUV] test string-21.1 {string wordend} { list [catch {string wordend a} msg] $msg |
