summaryrefslogtreecommitdiffstats
path: root/tests/indexObj.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-04-05 12:48:25 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-04-05 12:48:25 (GMT)
commita721d2a2fbcf2cacf3b6fffd2b4c09aaf5b83350 (patch)
tree700ad59b95fa4e0ffd08b435fca0d02b93a1e094 /tests/indexObj.test
parent5cf9d9ea363b50f4e62d13dfa68ad570c5de4e1d (diff)
downloadtcl-a721d2a2fbcf2cacf3b6fffd2b4c09aaf5b83350.zip
tcl-a721d2a2fbcf2cacf3b6fffd2b4c09aaf5b83350.tar.gz
tcl-a721d2a2fbcf2cacf3b6fffd2b4c09aaf5b83350.tar.bz2
Nail [Bug 1464039] by allowing the empty string to be exactly matched by
Tcl_GetIndexFromObj. Also added tests.
Diffstat (limited to 'tests/indexObj.test')
-rw-r--r--tests/indexObj.test18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/indexObj.test b/tests/indexObj.test
index ca58cc3..6df9082 100644
--- a/tests/indexObj.test
+++ b/tests/indexObj.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: indexObj.test,v 1.10 2006/02/16 20:25:07 dgp Exp $
+# RCS: @(#) $Id: indexObj.test,v 1.11 2006/04/05 12:48:26 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -38,6 +38,12 @@ test indexObj-1.6 {forced exact match} testindexobj {
test indexObj-1.7 {forced exact match} testindexobj {
testindexobj 1 0 x abc def xalb xyz alm x
} {5}
+test indexObj-1.8 {exact match of empty values} testindexobj {
+ testindexobj 1 1 {} a aa aaa {} b bb bbb
+} 3
+test indexObj-1.9 {exact match of empty values} testindexobj {
+ testindexobj 1 0 {} a aa aaa {} b bb bbb
+} 3
test indexObj-2.1 {no match} testindexobj {
list [catch {testindexobj 1 1 dddd abc def xalb xyz alm x} msg] $msg
@@ -57,6 +63,12 @@ test indexObj-2.5 {omit error message} testindexobj {
test indexObj-2.6 {TCL_EXACT => no "ambiguous" error message} {
list [catch {testindexobj 1 0 d dumb daughter a c} msg] $msg
} {1 {bad token "d": must be dumb, daughter, a, or c}}
+test indexObj-2.7 {exact match of empty values} testindexobj {
+ list [catch {testindexobj 1 1 {} a b c} msg] $msg
+} {1 {bad token "": must be a, b, or c}}
+test indexObj-2.8 {exact match of empty values: singleton case} testindexobj {
+ list [catch {testindexobj 1 1 {} a} msg] $msg
+} {1 {bad token "": must be a}}
test indexObj-3.1 {cache result to skip next lookup} testindexobj {
testindexobj check 42
@@ -114,3 +126,7 @@ test indexObj-6.4 {Tcl_GetIndexFromObjStruct} testindexobj {
# cleanup
::tcltest::cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: