summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-05-28 04:31:14 (GMT)
committerhobbs <hobbs>2001-05-28 04:31:14 (GMT)
commit08871cd59928d97b02d2821ef9dfa5024bf79806 (patch)
tree5084d78f7188bda95e5f05f1dd3a50a7f2123366
parentb0b6fb04908df93939a3dd4f3428c7e238d2e8f5 (diff)
downloadtcl-08871cd59928d97b02d2821ef9dfa5024bf79806.zip
tcl-08871cd59928d97b02d2821ef9dfa5024bf79806.tar.gz
tcl-08871cd59928d97b02d2821ef9dfa5024bf79806.tar.bz2
tests/utf.test: added tests to check unicode 3 compliance
-rw-r--r--tests/utf.test40
1 files changed, 32 insertions, 8 deletions
diff --git a/tests/utf.test b/tests/utf.test
index 7ac3ee2..0ba2414 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: utf.test,v 1.7 2000/04/10 17:19:05 ericm Exp $
+# RCS: @(#) $Id: utf.test,v 1.8 2001/05/28 04:31:14 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -257,7 +257,13 @@ test utf-20.1 {TclUniCharNcmp} {
} {}
test utf-21.1 {TclUniCharIsAlnum} {
-} {}
+ # this returns 1 with Unicode 3 compliance
+ string is alnum \u1040\u021f
+} {1}
+test utf-21.2 {unicode alnum char in regc_locale.c} {
+ # this returns 1 with Unicode 3 compliance
+ list [regexp {^[[:alnum:]]+$} \u1040\u021f] [regexp {^\w+$} \u1040\u021f]
+} {1 1}
test utf-22.1 {TclUniCharIsWordChar} {
string wordend "xyz123_bar fg" 0
@@ -265,15 +271,33 @@ test utf-22.1 {TclUniCharIsWordChar} {
test utf-22.2 {TclUniCharIsWordChar} {
string wordend "x\u5080z123_bar\u203c fg" 0
} 10
-
+
test utf-23.1 {TclUniCharIsAlpha} {
-} {}
+ # this returns 1 with Unicode 3 compliance
+ string is alpha \u021f
+} {1}
+test utf-23.2 {unicode alpha char in regc_locale.c} {
+ # this returns 1 with Unicode 3 compliance
+ regexp {^[[:alpha:]]+$} \u021f
+} {1}
test utf-24.1 {TclUniCharIsDigit} {
-} {}
-
-test utf-24.2 {TclUniCharIsSpace} {
-} {}
+ # this returns 1 with Unicode 3 compliance
+ string is digit \u1040
+} {1}
+test utf-24.2 {unicode digit char in regc_locale.c} {
+ # this returns 1 with Unicode 3 compliance
+ list [regexp {^[[:digit:]]+$} \u1040] [regexp {^\d+$} \u1040]
+} {1 1}
+
+test utf-24.1 {TclUniCharIsSpace} {
+ # this returns 1 with Unicode 3 compliance
+ string is space \u1680
+} {1}
+test utf-24.2 {unicode space char in regc_locale.c} {
+ # this returns 1 with Unicode 3 compliance
+ list [regexp {^[[:space:]]+$} \u1680] [regexp {^\s+$} \u1680]
+} {1 1}
# cleanup
::tcltest::cleanupTests