3 # Copyright (C) 2004-2007, The Perl Foundation.
6 # the following lines re-execute this as a tcl script
7 # the \ at the end of these lines makes them a comment in tcl \
8 use lib qw(languages/tcl/lib tcl/lib lib ../lib ../../lib); # \
12 source lib/test_more.tcl
20 } {2 {}} {return value}
27 } {foo bar} {return value from user-defined command}
55 } {wrong # args: should be "me a b"} {too many args}
62 } {wrong # args: should be "me a b"} {too few args}
67 } {wrong # args: should be "test"} {bad args - expected none}
74 } {wrong # args: should be "me a b ..."} {bad varargs}
81 } {2 {3 4 5 6}} {vararg}
88 } {2 {}} {vararg empty}
92 proc incr {varName} {return $varName}
93 proc test {} { incr a }
98 } {a} {using a renamed builtin}
101 proc a::b {} {puts a::b}
103 } {can't create procedure "a::b": unknown namespace} {unknown namespace}
110 } {2 7} {default args}
116 } {too many fields in argument specifier "a 2 3"} {bad default arg spec}
119 proc test {{a 2} b} {list $a $b}
121 } {wrong # args: should be "test ?a? b"} {default arg with too few args}
124 proc test {{a 2}} {return $a}
126 } {wrong # args: should be "test ?a?"} {default too many args}
133 } 4 {reset call_level on bad args}
139 } {} {empty procs are ok}