diff options
author | stanton <stanton> | 1998-10-16 01:16:57 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-10-16 01:16:57 (GMT) |
commit | d6641aab890671957021803671e40455649ea3dd (patch) | |
tree | 44b91406ef88c0df8702056d46601cd7d3c9014e /tests/utf.test | |
parent | aea8306abb880c9d2d7e31089e92348b137e4935 (diff) | |
download | tcl-d6641aab890671957021803671e40455649ea3dd.zip tcl-d6641aab890671957021803671e40455649ea3dd.tar.gz tcl-d6641aab890671957021803671e40455649ea3dd.tar.bz2 |
Added Unicode character table support:
added TclUniCharIsWordChar
tclCmdMZ.c (Tcl_StringObjCmd): added "totitle" subcommand,
changed "wordend" and "wordstart" to properly handle Unicode word
characters and connector punctuation
Diffstat (limited to 'tests/utf.test')
-rw-r--r-- | tests/utf.test | 114 |
1 files changed, 92 insertions, 22 deletions
diff --git a/tests/utf.test b/tests/utf.test index 234048b..f7e5922 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -161,37 +161,107 @@ bsCheck \ua1 161 bsCheck \u4e21 63 test utf-11.1 {Tcl_UtfToUpper} { + string toupper {} +} {} +test utf-11.2 {Tcl_UtfToUpper} { string toupper abc } ABC -test utf-11.2 {Tcl_UtfToUpper} {hasIsoLocale} { - set_iso8859_1_locale - set result [string toupper \u00e3ab] - restore_locale - set result +test utf-11.3 {Tcl_UtfToUpper} { + string toupper \u00e3ab } \u00c3AB -test utf-11.3 {Tcl_UtfToUpper} {hasIsoLocale} { - set_iso8859_1_locale - set result [string toupper \u01e3ab] - restore_locale - set result -} \u01e3AB +test utf-11.4 {Tcl_UtfToUpper} { + string toupper \u01e3ab +} \u01e2AB test utf-12.1 {Tcl_UtfToLower} { + string tolower {} +} {} +test utf-12.2 {Tcl_UtfToLower} { string tolower ABC } abc -test utf-12.2 {Tcl_UtfToLower} {hasIsoLocale} { - set_iso8859_1_locale - set result [string tolower \u00c3AB] - restore_locale - set result +test utf-12.3 {Tcl_UtfToLower} { + string tolower \u00c3AB } \u00e3ab -test utf-12.3 {Tcl_UtfToLower} {hasIsoLocale} { - set_iso8859_1_locale - set result [string tolower \u01c3AB] - restore_locale - set result -} \u01c3ab +test utf-12.4 {Tcl_UtfToLower} { + string tolower \u01e2AB +} \u01e3ab + +test utf-13.1 {Tcl_UtfToTitle} { + string totitle {} +} {} +test utf-13.2 {Tcl_UtfToTitle} { + string totitle abc +} Abc +test utf-13.3 {Tcl_UtfToTitle} { + string totitle \u00e3ab +} \u00c3ab +test utf-13.4 {Tcl_UtfToTitle} { + string totitle \u01f3ab +} \u01f2ab + +test utf-14.1 {Tcl_UniCharToUpper, negative delta} { + string toupper aA +} AA +test utf-14.2 {Tcl_UniCharToUpper, positive delta} { + string toupper \u0178\u00ff +} \u0178\u0178 +test utf-14.3 {Tcl_UniCharToUpper, no delta} { + string toupper ! +} ! +test utf-15.1 {Tcl_UniCharToLower, negative delta} { + string tolower aA +} aa +test utf-15.2 {Tcl_UniCharToLower, positive delta} { + string tolower \u0178\u00ff +} \u00ff\u00ff +test utf-16.1 {Tcl_UniCharToLower, no delta} { + string tolower ! +} ! + +test utf-17.1 {Tcl_UniCharToTitle, add one for title} { + string totitle \u01c4 +} \u01c5 +test utf-17.2 {Tcl_UniCharToTitle, subtract one for title} { + string totitle \u01c6 +} \u01c5 +test utf-17.3 {Tcl_UniCharToTitle, subtract delta for title (positive)} { + string totitle \u017f +} \u0053 +test utf-17.4 {Tcl_UniCharToTitle, subtract delta for title (negative)} { + string totitle \u00ff +} \u0178 +test utf-17.5 {Tcl_UniCharToTitle, no delta} { + string totitle ! +} ! + +test utf-18.1 {TclUniCharLen} { + list [regexp \\d abc456def foo] $foo +} {1 4} + +test utf-19.1 {TclUniCharNcmp} { +} {} + +test utf-20.1 {TclUniCharIsAlnum} { +} {} + +test utf-21.1 {TclUniCharIsWordChar} { + string wordend "xyz123_bar fg" 0 +} 10 +test utf-21.1 {TclUniCharIsWordChar} { + string wordend "x\u5080z123_bar\u203c fg" 0 +} 10 + +test utf-22.1 {TclUniCharIsAlpha} { +} {} + +test utf-23.1 {TclUniCharIsDigit} { +} {} + +test utf-23.1 {TclUniCharIsSpace} { +} {} return + + |