diff options
author | dgp <dgp@users.sourceforge.net> | 2020-04-27 17:29:59 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-04-27 17:29:59 (GMT) |
commit | 165a986a41b58b0052245b73ee99a4772d0dbb17 (patch) | |
tree | 86a35a310f82f6c4076e4883882e197cc110c7aa /tests | |
parent | ef40d8b856bb942c31983aff1615c5d1ef21508a (diff) | |
download | tcl-165a986a41b58b0052245b73ee99a4772d0dbb17.zip tcl-165a986a41b58b0052245b73ee99a4772d0dbb17.tar.gz tcl-165a986a41b58b0052245b73ee99a4772d0dbb17.tar.bz2 |
Parameterize tests of Tcl_UniCharNcasecmp
Diffstat (limited to 'tests')
-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 |