summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorericm <ericm>2000-08-07 22:42:31 (GMT)
committerericm <ericm>2000-08-07 22:42:31 (GMT)
commit6010721a7deebd7a9b038b2ae93b4d8bd8f7cb24 (patch)
tree61d50d1446176d04a1b82fa826f3b9a3afbaa10e /tests
parent17cf10d104c7cd7e936cbab403f027b19d3ac265 (diff)
downloadtcl-6010721a7deebd7a9b038b2ae93b4d8bd8f7cb24.zip
tcl-6010721a7deebd7a9b038b2ae93b4d8bd8f7cb24.tar.gz
tcl-6010721a7deebd7a9b038b2ae93b4d8bd8f7cb24.tar.bz2
* tests/indexObj.test: Added tests using the [testwrongnumargs]
command to test Tcl_WrongNumArgs. * generic/tclTest.c (TestWrongNumArgsObjCmd): Added test function for the Tcl_WrongNumArgs function. * generic/tclIndexObj.c (Tcl_WrongNumArgs): Corrected algorithm to not insert a space before the message component when objc == 0 [Bug: 6078].
Diffstat (limited to 'tests')
-rw-r--r--tests/indexObj.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/indexObj.test b/tests/indexObj.test
index 6a69a9d..4dd83f5 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.5 2000/04/10 17:19:00 ericm Exp $
+# RCS: @(#) $Id: indexObj.test,v 1.6 2000/08/07 22:42:32 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -70,6 +70,25 @@ 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\""
+
# cleanup
::tcltest::cleanupTests
return