diff options
Diffstat (limited to 'tests/init.test')
-rw-r--r-- | tests/init.test | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/init.test b/tests/init.test index 79142c4..7bdbd82 100644 --- a/tests/init.test +++ b/tests/init.test @@ -11,12 +11,12 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2 namespace import -force ::tcltest::* } # Clear out any namespaces called test_ns_* -catch {eval namespace delete [namespace children :: test_ns_*]} +catch {namespace delete {*}[namespace children :: test_ns_*]} # Six cases - white box testing @@ -194,6 +194,19 @@ foreach arg [subst -nocommands -novariables { incr count } +test init-5.0 {return options passed through ::unknown} -setup { + catch {rename xxx {}} + set ::auto_index(::xxx) {proc ::xxx {} { + return -code error -level 2 xxx + }} +} -body { + set code [catch {::xxx} foo bar] + set code2 [catch {::xxx} foo2 bar2] + list $code $foo $bar $code2 $foo2 $bar2 +} -cleanup { + unset ::auto_index(::xxx) +} -result {2 xxx {-errorcode NONE -code 1 -level 1} 2 xxx {-code 1 -level 1 -errorcode NONE}} + cleanupTests } ;# End of [interp eval $testInterp] |