summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-04-18 14:12:07 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-04-18 14:12:07 (GMT)
commit99698119e81825308e2a3790fc046c4c9fe63b40 (patch)
tree79a8462334384e4c8831cc45887a5e04e182e0a0 /tests
parent85e2515f134ae9dee84eaab360465cc92116796f (diff)
downloadtcl-99698119e81825308e2a3790fc046c4c9fe63b40.zip
tcl-99698119e81825308e2a3790fc046c4c9fe63b40.tar.gz
tcl-99698119e81825308e2a3790fc046c4c9fe63b40.tar.bz2
Fixed Bug #545644; [info body] always gives a proper string now!
Diffstat (limited to 'tests')
-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"