From 215662c8ba97ab0ec4818e0b0bb0440be801219f Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 27 Apr 2020 19:17:40 +0000 Subject: Improve the reporting of a failing test. Start testing extended chars. --- tests/utf.test | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/utf.test b/tests/utf.test index c701913..ea13d1d 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -1295,8 +1295,14 @@ proc UniCharCaseCmpTest {order one two {constraints {}}} { teststringobj set 2 $two teststringobj getunicode 1 teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] - } -result [string map {< -1 = 0 > 1} $order] + set result [string compare -nocase [teststringobj get 1] [teststringobj get 2]] + if {$result eq [string map {< -1 = 0 > 1} $order]} { + set result ok + } else { + set result "'$one' should be $order '$two' (no case)" + } + set result + } -result ok incr count } variable count 1 @@ -1304,6 +1310,12 @@ UniCharCaseCmpTest < a b UniCharCaseCmpTest > b a UniCharCaseCmpTest > B a UniCharCaseCmpTest > aBcB abca +UniCharCaseCmpTest < \uFFFF [format %c 0x10000] fullutf +UniCharCaseCmpTest < \uFFFF \U10000 {Uesc fullutf} + + + + unset count rename UniCharCaseCmpTest {} -- cgit v0.12