summaryrefslogtreecommitdiffstats
path: root/tests/info.test
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2024-07-14 19:03:38 (GMT)
committersebres <sebres@users.sourceforge.net>2024-07-14 19:03:38 (GMT)
commit034fb5297ba42c8b9b371669fb60cda46ceb55fd (patch)
tree52d859bb54018f238c05280ea9db33dab0ca1f3e /tests/info.test
parent4447bb0099f30c9b8700f945e2c0fc5ae2a88d8c (diff)
downloadtcl-034fb5297ba42c8b9b371669fb60cda46ceb55fd.zip
tcl-034fb5297ba42c8b9b371669fb60cda46ceb55fd.tar.gz
tcl-034fb5297ba42c8b9b371669fb60cda46ceb55fd.tar.bz2
amend to [3d8bf31bdc], ultimately fixes [0e4b7fce57]: [info vars] should not resolve global vars in namespace by simple pattern too (see info-19.8 test);
added tests covering the behaviour
Diffstat (limited to 'tests/info.test')
-rw-r--r--tests/info.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/info.test b/tests/info.test
index 38fa5f2..42ceafc 100644
--- a/tests/info.test
+++ b/tests/info.test
@@ -2396,6 +2396,29 @@ test info-33.35 {{*}, literal, simple, bytecompiled} -body {
} -result {type source line 2389 file info.test cmd {info frame 0} proc ::foo::bar level 0}
# -------------------------------------------------------------------------
+
+test info-19.7 {info vars: bug [0e4b7fce57], TIP #278 - no global vars resolve} -setup {
+ catch {namespace delete x}
+} -body {
+ namespace eval x {info vars}
+} -cleanup {
+ namespace delete x
+} -result {}
+test info-19.8 {info vars: bug [0e4b7fce57], TIP #278 - no global vars resolve} -setup {
+ catch {namespace delete x}
+} -body {
+ namespace eval x {info vars tcl_platform}
+} -cleanup {
+ namespace delete x
+} -result {}
+test info-19.9 {info vars: global vars resolved by pattern} -setup {
+ catch {namespace delete x}
+} -body {
+ namespace eval x {info vars ::tcl_platform}
+} -cleanup {
+ namespace delete x
+} -result {::tcl_platform}
+
namespace eval ::testinfocmdtype {
apply {cmds {
foreach c $cmds {rename $c {}}