summaryrefslogtreecommitdiffstats
path: root/tests/opt.test
diff options
context:
space:
mode:
authorwelch <welch>1998-06-27 18:09:53 (GMT)
committerwelch <welch>1998-06-27 18:09:53 (GMT)
commite49b28cf440752d763d488c4673d081883e93033 (patch)
tree1215c0959e90294b37bd360985895f49e8cbea9f /tests/opt.test
parent32e60ee1bab18f9b5441eeb97eadcf604af608ef (diff)
downloadtcl-e49b28cf440752d763d488c4673d081883e93033.zip
tcl-e49b28cf440752d763d488c4673d081883e93033.tar.gz
tcl-e49b28cf440752d763d488c4673d081883e93033.tar.bz2
plugin updates
Diffstat (limited to 'tests/opt.test')
-rw-r--r--tests/opt.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/opt.test b/tests/opt.test
index 0b35b76..69d981c 100644
--- a/tests/opt.test
+++ b/tests/opt.test
@@ -253,3 +253,25 @@ test opt-10.10 {medium size overall test} {
list [catch {optTest save tst foo} msg] [lindex [split $msg "\n"] 0]
} {1 {too many arguments (unexpected argument(s): foo), usage:}}
+
+test opt-11.1 {too many args test 2} {
+ set key [::tcl::OptKeyRegister {-foo}]
+ list [catch {::tcl::OptKeyParse $key {-foo blah}} msg] $msg\
+ [::tcl::OptKeyDelete $key]
+} {1 {too many arguments (unexpected argument(s): blah), usage:
+ Var/FlagName Type Value Help
+ ------------ ---- ----- ----
+ ( -help gives this help )
+ -foo boolflag (false) } {}}
+
+
+
+test opt-11.2 {default value for args} {
+ set args {}
+ set key [::tcl::OptKeyRegister {{args -list {a b c} "args..."}}]
+ ::tcl::OptKeyParse $key {}
+ ::tcl::OptKeyDelete $key
+ set args
+} {a b c}
+
+