source [file dirname [info script]]/testing.tcl needs cmd leval test leval-1.1 {no args} -body { leval } -returnCodes error -result {wrong # args: should be "leval string"} test leval-1.2 {too many args} -body { leval } -returnCodes error -result {wrong # args: should be "leval string"} test leval-1.3 {basic, no subst} -body { leval {a b c} } -result {a b c} test leval-1.4 {basics, vars} -body { set a 1 set b "2 3" set c "4 5 6" set d ".1" leval {$a $b $c$d} } -result {1 {2 3} {4 5 6.1}} test leval-1.5 {comments} -body { # It is helpful to be able to include comments in a list definition # just like in a script leval { # comment line 1 2 3 # comment line with continuation \ this is also a comments 4 ;# comment at end of line 5 } } -result {1 2 3 4 5} test leval-1.6 {commands} -body { set a 0 leval { [incr a] [incr a] [list d e] [string cat f g][string cat h i] } } -result {1 2 {d e} fghi} test leval-1.7 {expand} -body { set a {1 2} set space " " set b {3 4 5} leval { {*}$a {*}$a$space$b$space[list 6 7] } } -result {1 2 1 2 3 4 5 6 7} testreport