source [file dirname [info script]]/testing.tcl needs constraint jim needs cmd array needs cmd ref test alias-1.1 "One word alias" { set x 2 alias newincr incr newincr x } {3} test alias-1.4 "Two word alias" { alias infoexists info exists infoexists x } {1} test alias-1.5 "Replace alias" { alias newincr infoexists newincr x } {1} test alias-1.6 "Delete alias" { rename newincr "" catch {newincr x} } {1} test alias-1.7 "Replace alias with proc" { proc infoexists {n} { return yes } infoexists any } {yes} test alias-1.8 "Replace proc with alias" { alias infoexists info exists infoexists any } {0} test alias-1.9 "error message from alias" -body { alias newstring string newstring match } -returnCodes error -result {wrong # args: should be "string match ?-nocase? pattern string"} test alias-1.10 "info alias" { alias x info exists info alias x } {info exists} test alias-1.10 "info alias on non-alias" -body { info alias format } -returnCodes error -result {command "format" is not an alias} test curry-1.1 "One word curry" { set x 2 set one [curry incr] $one x } {3} test curry-1.4 "Two word curry" { set two [curry info exists] list [$two x] [$two y] } {1 0} test curry-1.5 "Delete curry" references { collect $one abc unset one two collect } {2} test local-1.2 "local curry in proc" { proc a {} { local set p [curry info exists] set x 1 list $p [$p x] [$p y] } lassign [a] p exists_x exists_y list [info procs $p] $exists_x $exists_y } {{} 1 0} test local-1.2 "set local curry in proc" { proc a {} { set p [local curry info exists] set x 1 list $p [$p x] [$p y] } lassign [a] p exists_x exists_y list [info procs $p] $exists_x $exists_y } {{} 1 0} test local-1.3 "local alias in proc" { proc a {} { local alias p info exists set x 1 list [p x] [p y] } lassign [a] exists_x exists_y list [info commands p] $exists_x $exists_y } {{} 1 0} test local-1.5 "local proc in proc" { set ::x 1 proc a {} { local proc b {} { incr ::x } b set ::x } a list [info procs b] $::x } {{} 2} test local-1.6 "local lambda in lsort" { proc a {} { lsort -command [local lambda {a b} {string compare $a $b}] {d a f g} } a } {a d f g} test local-1.7 "check no reference procs" { info procs "