diff options
author | welch <welch> | 1998-06-27 18:09:53 (GMT) |
---|---|---|
committer | welch <welch> | 1998-06-27 18:09:53 (GMT) |
commit | e49b28cf440752d763d488c4673d081883e93033 (patch) | |
tree | 1215c0959e90294b37bd360985895f49e8cbea9f /tests/opt.test | |
parent | 32e60ee1bab18f9b5441eeb97eadcf604af608ef (diff) | |
download | tcl-e49b28cf440752d763d488c4673d081883e93033.zip tcl-e49b28cf440752d763d488c4673d081883e93033.tar.gz tcl-e49b28cf440752d763d488c4673d081883e93033.tar.bz2 |
plugin updates
Diffstat (limited to 'tests/opt.test')
-rw-r--r-- | tests/opt.test | 22 |
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} + + |