summaryrefslogtreecommitdiffstats
path: root/tests/info.test
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2002-04-18 14:12:07 (GMT)
committerdkf <dkf@noemail.net>2002-04-18 14:12:07 (GMT)
commit437400e9bdeb47c4a2591bd7dc533315b46d60ec (patch)
tree79a8462334384e4c8831cc45887a5e04e182e0a0 /tests/info.test
parent932902ccb7776d56d2a245a51459c3542ee49ad5 (diff)
downloadtcl-437400e9bdeb47c4a2591bd7dc533315b46d60ec.zip
tcl-437400e9bdeb47c4a2591bd7dc533315b46d60ec.tar.gz
tcl-437400e9bdeb47c4a2591bd7dc533315b46d60ec.tar.bz2
Fixed Bug #545644; [info body] always gives a proper string now!
FossilOrigin-Name: 7a7778468263e6840c16f00818509d1c4a4f8bb5
Diffstat (limited to 'tests/info.test')
-rw-r--r--tests/info.test18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/info.test b/tests/info.test
index 9ed73b2..0e209fc 100644
--- a/tests/info.test
+++ b/tests/info.test
@@ -11,7 +11,7 @@
# 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.18 2002/02/15 14:28:50 dkf Exp $
+# RCS: @(#) $Id: info.test,v 1.19 2002/04/18 14:12:07 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -79,11 +79,11 @@ test info-2.4 {info body option} {
list [info body p] [info body q]
}
} {{return "x=$x"} {return "y=$y"}}
+# Prior to 8.3.0 this would cause a crash because [info body]
+# would return the bytecompiled version of foo, which the catch
+# would then try and eval out of the foo context, accessing
+# compiled local indices
test info-2.5 {info body option, returning bytecompiled bodies} {
- # Prior to 8.3.0 this would cause a crash because [info body]
- # would return the bytecompiled version of foo, which the catch
- # would then try and eval out of the foo context, accessing
- # compiled local indices
catch {unset args}
proc foo {args} {
foreach v $args {
@@ -94,6 +94,14 @@ test info-2.5 {info body option, returning bytecompiled bodies} {
foo a
list [catch [info body foo] msg] $msg
} {1 {can't read "args": no such variable}}
+# Fix for problem tested for in info-2.5 caused problems when
+# procedure body had no string rep (i.e. was not yet bytecode)
+# causing an empty string to be returned [Bug #545644]
+test info-2.6 {info body option, returning list bodies} {
+ proc foo args [list subst bar]
+ list [string bytelength [info body foo]] \
+ [foo; string bytelength [info body foo]]
+} {9 9}
# "info cmdcount" is no longer accurate for compiled commands!
# The expected result for info-3.1 used to be "3" and is now "1"