diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2005-07-29 14:57:25 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2005-07-29 14:57:25 (GMT) |
commit | 34c1b26fda7971d730ebcf6498ef36793dc84609 (patch) | |
tree | 062cd7e13a1afaeefc61eebd4c57c117336664b6 /tests/info.test | |
parent | cfb0529d87cadc7480b14d0b3379ecf7ed5802c9 (diff) | |
download | tcl-34c1b26fda7971d730ebcf6498ef36793dc84609.zip tcl-34c1b26fda7971d730ebcf6498ef36793dc84609.tar.gz tcl-34c1b26fda7971d730ebcf6498ef36793dc84609.tar.bz2 |
Take care with globals that have an entry in the var table but "don't exist"
Diffstat (limited to 'tests/info.test')
-rw-r--r-- | tests/info.test | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/info.test b/tests/info.test index 0f65324..7a31b27 100644 --- a/tests/info.test +++ b/tests/info.test @@ -11,10 +11,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: info.test,v 1.24.2.3 2004/11/24 19:28:13 dgp Exp $ +# RCS: @(#) $Id: info.test,v 1.24.2.4 2005/07/29 14:57:28 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2 namespace import -force ::tcltest::* } @@ -295,6 +295,19 @@ test info-8.4 {info globals option: may have leading namespace qualifiers} { set x 0 list [info globals x] [info globals :x] [info globals ::x] [info globals :::x] [info globals ::::x] } {x {} x x x} +test info-8.5 {info globals option: only return existing global variables} { + -setup { + catch {unset ::NO_SUCH_VAR} + proc evalInProc script {eval $script} + } + -body { + evalInProc {global NO_SUCH_VAR; info globals NO_SUCH_VAR} + } + -cleanup { + rename evalInProc {} + } + -result {} +} test info-9.1 {info level option} { info level |