summaryrefslogtreecommitdiff
path: root/tcl/tests/indexObj.test
diff options
context:
space:
mode:
Diffstat (limited to 'tcl/tests/indexObj.test')
-rw-r--r--tcl/tests/indexObj.test39
1 files changed, 38 insertions, 1 deletions
diff --git a/tcl/tests/indexObj.test b/tcl/tests/indexObj.test
index c372ec7a385..4ece4155ff8 100644
--- a/tcl/tests/indexObj.test
+++ b/tcl/tests/indexObj.test
@@ -70,6 +70,44 @@ test indexObj-4.1 {free old internal representation} {
testindexobj 1 1 $x abc def {a b} zzz
} {2}
+test indexObj-5.1 {Tcl_WrongNumArgs} {
+ testwrongnumargs 1 "?option?" mycmd
+} "wrong # args: should be \"mycmd ?option?\""
+test indexObj-5.2 {Tcl_WrongNumArgs} {
+ testwrongnumargs 2 "bar" mycmd foo
+} "wrong # args: should be \"mycmd foo bar\""
+test indexObj-5.3 {Tcl_WrongNumArgs} {
+ testwrongnumargs 0 "bar" mycmd foo
+} "wrong # args: should be \"bar\""
+test indexObj-5.4 {Tcl_WrongNumArgs} {
+ testwrongnumargs 0 "" mycmd foo
+} "wrong # args: should be \"\""
+test indexObj-5.5 {Tcl_WrongNumArgs} {
+ testwrongnumargs 1 "" mycmd foo
+} "wrong # args: should be \"mycmd\""
+test indexObj-5.6 {Tcl_WrongNumArgs} {
+ testwrongnumargs 2 "" mycmd foo
+} "wrong # args: should be \"mycmd foo\""
+
+test indexObj-6.1 {Tcl_GetIndexFromObjStruct} {
+ set x a
+ testgetindexfromobjstruct $x 0
+} "wrong # args: should be \"testgetindexfromobjstruct a 0\""
+test indexObj-6.2 {Tcl_GetIndexFromObjStruct} {
+ set x a
+ testgetindexfromobjstruct $x 0
+ testgetindexfromobjstruct $x 0
+} "wrong # args: should be \"testgetindexfromobjstruct a 0\""
+test indexObj-6.3 {Tcl_GetIndexFromObjStruct} {
+ set x c
+ testgetindexfromobjstruct $x 1
+} "wrong # args: should be \"testgetindexfromobjstruct c 1\""
+test indexObj-6.4 {Tcl_GetIndexFromObjStruct} {
+ set x c
+ testgetindexfromobjstruct $x 1
+ testgetindexfromobjstruct $x 1
+} "wrong # args: should be \"testgetindexfromobjstruct c 1\""
+
# cleanup
::tcltest::cleanupTests
return
@@ -85,4 +123,3 @@ return
-