From f8e147cb73f34eb486c128a840ceddacdee2677b Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 1 Aug 2013 06:44:24 +0000 Subject: Improving the test suite for [info cmdtype]. --- tests/info.test | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/info.test b/tests/info.test index ef6bba9..f3517f9 100644 --- a/tests/info.test +++ b/tests/info.test @@ -2475,6 +2475,34 @@ test info-40.12 {info cmdtype: objects} -setup { } -cleanup { ::testinfocmdtype::obj destroy } -result privateObject +test info-40.13 {info cmdtype: ensembles} -setup { + namespace eval ::testinfocmdtype { + namespace eval ensmbl { + proc bar {} {} + namespace export * + namespace ensemble create + } + } +} -body { + info cmdtype ::testinfocmdtype::ensmbl +} -cleanup { + namespace delete ::testinfocmdtype::ensmbl +} -result ensemble +test info-40.14 {info cmdtype: dynamic behavior} -setup { + proc ::testinfocmdtype::foo {} {} +} -body { + namespace eval ::testinfocmdtype { + list [catch {info cmdtype foo}] [catch {info cmdtype bar}] \ + [namespace which foo] [rename foo bar] [namespace which bar] \ + [catch {info cmdtype foo}] [catch {info cmdtype bar}] + } +} -cleanup { + namespace eval ::testinfocmdtype { + catch {rename foo {}} + catch {rename bar {}} + } +} -result {0 1 ::testinfocmdtype::foo {} ::testinfocmdtype::bar 1 0} +namespace delete ::testinfocmdtype # ------------------------------------------------------------------------- unset -nocomplain res -- cgit v0.12