summaryrefslogtreecommitdiffstats
path: root/tests/string.test
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2001-04-06 10:50:00 (GMT)
committerdkf <dkf@noemail.net>2001-04-06 10:50:00 (GMT)
commitc52c978a0d94ceb82218ba68c74f96a12604d253 (patch)
tree81860bb7f263e253fa649925296741b94c4e752b /tests/string.test
parent25949fd2a60b69e5a98d72f1b12eeb297157806d (diff)
downloadtcl-c52c978a0d94ceb82218ba68c74f96a12604d253.zip
tcl-c52c978a0d94ceb82218ba68c74f96a12604d253.tar.gz
tcl-c52c978a0d94ceb82218ba68c74f96a12604d253.tar.bz2
Fixed problem with [string compare \x00 \x01] and hopefully sped the
command up in a few cases too (notably byte arrays and UNICODE objects.) [Bug #219201] FossilOrigin-Name: 6677432d73b149f9509c4c48c313ed077626e881
Diffstat (limited to 'tests/string.test')
-rw-r--r--tests/string.test11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/string.test b/tests/string.test
index d725cc4..aad463e 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: string.test,v 1.27 2001/03/12 15:58:01 dkf Exp $
+# RCS: @(#) $Id: string.test,v 1.28 2001/04/06 10:50:00 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -119,12 +119,17 @@ test string-2.26 {string compare -nocase, null strings} {
test string-2.27 {string compare -nocase, null strings} {
string compare -nocase foo ""
} 1
-test string-2.28 {string equal with length, unequal strings} {
+test string-2.28 {string compare with length, unequal strings} {
string compare -length 2 abc abde
} 0
-test string-2.29 {string equal with length, unequal strings} {
+test string-2.29 {string compare with length, unequal strings} {
string compare -length 2 ab abde
} 0
+test string-2.30 {string compare with NUL character vs. other ASCII} {
+ # Be careful here, since UTF-8 rep comparison with memcmp() of
+ # these puts chars in the wrong order
+ string compare \x00 \x01
+} -1
# only need a few tests on equal, since it uses the same code as
# string compare, but just modifies the return output