diff options
Diffstat (limited to 'tests/utf.test')
-rw-r--r-- | tests/utf.test | 72 |
1 files changed, 17 insertions, 55 deletions
diff --git a/tests/utf.test b/tests/utf.test index 821b548..c701913 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -1284,67 +1284,29 @@ test utf-24.6 {unicode space char in regc_locale.c} tip413 { list [regexp {^[[:space:]]+$} \x85\u1680\u180E\u200B\u202F\u2060] [regexp {^\s+$} \x85\u1680\u180E\u200B\u202F\u2060] } {1 1} -test utf-25.1 {Tcl_UniCharNcasecmp} -constraints teststringobj \ - -setup { +proc UniCharCaseCmpTest {order one two {constraints {}}} { + variable count + test utf-25.$count {Tcl_UniCharNcasecmp} -setup { testobj freeallvars - } \ - -body { - teststringobj set 1 a - teststringobj set 2 b - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] - } \ - -cleanup { - testobj freeallvars - } \ - -result -1 -test utf-25.2 {Tcl_UniCharNcasecmp} -constraints teststringobj \ - -setup { - testobj freeallvars - } \ - -body { - teststringobj set 1 b - teststringobj set 2 a - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] - } \ - -cleanup { + } -constraints [linsert $constraints 0 teststringobj] -cleanup { testobj freeallvars - } \ - -result 1 -test utf-25.3 {Tcl_UniCharNcasecmp} -constraints teststringobj \ - -setup { - testobj freeallvars - } \ - -body { - teststringobj set 1 B - teststringobj set 2 a + } -body { + teststringobj set 1 $one + teststringobj set 2 $two teststringobj getunicode 1 teststringobj getunicode 2 string compare -nocase [teststringobj get 1] [teststringobj get 2] - } \ - -cleanup { - testobj freeallvars - } \ - -result 1 + } -result [string map {< -1 = 0 > 1} $order] + incr count +} +variable count 1 +UniCharCaseCmpTest < a b +UniCharCaseCmpTest > b a +UniCharCaseCmpTest > B a +UniCharCaseCmpTest > aBcB abca -test utf-25.4 {Tcl_UniCharNcasecmp} -constraints teststringobj \ - -setup { - testobj freeallvars - } \ - -body { - teststringobj set 1 aBcB - teststringobj set 2 abca - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] - } \ - -cleanup { - testobj freeallvars - } \ - -result 1 +unset count +rename UniCharCaseCmpTest {} # cleanup ::tcltest::cleanupTests |