summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-10-08 14:21:18 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-10-08 14:21:18 (GMT)
commitc523c442ea40722320430dc7ba32673b7b191a90 (patch)
treec7a20e4018242cdfdaa708c55f922f1d0cc48b5a /tests
parent1cf2d1bce788d1be36ad8372e2c5c194c88921ba (diff)
downloadtcl-c523c442ea40722320430dc7ba32673b7b191a90.zip
tcl-c523c442ea40722320430dc7ba32673b7b191a90.tar.gz
tcl-c523c442ea40722320430dc7ba32673b7b191a90.tar.bz2
Made Tcl_NumUtfChars do the right thing with \u0000 when guessing the length
because of a negative 'length' parameter. [Bug 769812]
Diffstat (limited to 'tests')
-rw-r--r--tests/utf.test23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/utf.test b/tests/utf.test
index 56e1b5f..cd4803c 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.8.14.2 2003/03/27 13:11:18 dkf Exp $
+# RCS: @(#) $Id: utf.test,v 1.8.14.3 2003/10/08 14:21:21 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -59,14 +59,29 @@ test utf-3.1 {Tcl_UtfCharComplete} {
} {}
test utf-4.1 {Tcl_NumUtfChars: zero length} {
- string length ""
+ testnumutfchars ""
} {0}
test utf-4.2 {Tcl_NumUtfChars: length 1} {
- string length [bytestring "\xC2\xA2"]
+ testnumutfchars [bytestring "\xC2\xA2"]
} {1}
test utf-4.3 {Tcl_NumUtfChars: long string} {
- string length [bytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"]
+ testnumutfchars [bytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"]
} {7}
+test utf-4.4 {Tcl_NumUtfChars: #u0000} {
+ testnumutfchars [bytestring "\xC0\x80"]
+} {1}
+test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} {
+ testnumutfchars "" 1
+} {0}
+test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {
+ testnumutfchars [bytestring "\xC2\xA2"] 1
+} {1}
+test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {
+ testnumutfchars [bytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"] 1
+} {7}
+test utf-4.8 {Tcl_NumUtfChars: #u0000, calc len} {
+ testnumutfchars [bytestring "\xC0\x80"] 1
+} {1}
test utf-5.1 {Tcl_UtfFindFirsts} {
} {}