diff options
author | andreas_kupries <akupries@shaw.ca> | 2010-08-03 16:58:01 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2010-08-03 16:58:01 (GMT) |
commit | a806b22a63bbc7ded535172808d56e1d5cf258f8 (patch) | |
tree | e0c169780b38b711c0e9254a5e05886b0b763cd2 | |
parent | e3f847d794ab13dc6a5452ea294669c8a6b2ae37 (diff) | |
download | tcl-a806b22a63bbc7ded535172808d56e1d5cf258f8.zip tcl-a806b22a63bbc7ded535172808d56e1d5cf258f8.tar.gz tcl-a806b22a63bbc7ded535172808d56e1d5cf258f8.tar.bz2 |
* tests/info.test (info-39.1): Added forward copy of test in 8.5
branch about [Bug 2933089]. Should not fail, and doesn't, after
updating the line numbers to the changed position.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tests/info.test | 43 |
2 files changed, 48 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2010-08-03 Andreas Kupries <andreask@activestate.com> + + * tests/info.test (info-39.1): Added forward copy of test in 8.5 + branch about [Bug 2933089]. Should not fail, and doesn't, after + updating the line numbers to the changed position. + 2010-08-02 Kevin B. Kenny <kennykb@users.sf.net> * library/tzdata/America/Bahia_Banderas: diff --git a/tests/info.test b/tests/info.test index b25f4a6..9a919bc 100644 --- a/tests/info.test +++ b/tests/info.test @@ -13,7 +13,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.76 2010/04/05 19:44:45 ferrieux Exp $ +# RCS: @(#) $Id: info.test,v 1.77 2010/08/03 16:58:01 andreas_kupries Exp $ if {{::tcltest} ni [namespace children]} { package require tcltest 2 @@ -1837,6 +1837,47 @@ test info-30.48 {Bug 2850901} testevalex { ][reduce [info frame 0]]} ; # line 2 of the eval } {type eval line 2 cmd {info frame 0} proc ::tcltest::RunTest} + +# ------------------------------------------------------------------------- +# literal sharing 2, bug 2933089 + +test info-39.1 {location information not confused by literal sharing, bug 2933089} -setup { + set result {} + + proc print_one {} {} + proc test_info_frame {} { + set x 1 + set y x + + if "$x != 1" { + } else { + print_one + } ;#line 1855^ + + if "$$y != 1" { + } else { + print_one + } ;#line 1860^ + # Do not put the comments listing the line numbers into the + # branches. We need shared literals, and the comments would + # make them different, thus unshared. + } + + proc get_frame_info { cmd_str op } { + lappend ::result [reduce [eval {info frame -3}]] + } + trace add execution print_one enter get_frame_info +} -body { + test_info_frame; + join $result \n +} -cleanup { + trace remove execution print_one enter get_frame_info + rename get_frame_info {} + rename test_info_frame {} + rename print_one {} +} -result {type source line 1855 file info.test cmd print_one proc ::test_info_frame level 1 +type source line 1860 file info.test cmd print_one proc ::test_info_frame level 1} + # ------------------------------------------------------------------------- unset -nocomplain res |