9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2006 ActiveState
#
# 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.11 2008/07/28 20:01:12 andreas_kupries Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
namespace import -force ::tcltest::*
}
# Set up namespaces needed to test operation of "info args", "info body",
|
|
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2006 ActiveState
#
# 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.12 2009/07/14 16:31:49 andreas_kupries Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
namespace import -force ::tcltest::*
}
# Set up namespaces needed to test operation of "info args", "info body",
|
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
|
join [lrange [datal] 0 4] \n
} -result {* {type source line 723 file info.test cmd {info frame $level} proc ::etrace level 0}
* {type source line 1139 file info.test cmd etrace proc ::control}
* {type source line 1133 file info.test cmd {uplevel 1 $script} proc ::control}
* {type source line 1137 file info.test cmd control proc ::datal level 1}
* {type source line 1200 file info.test cmd datal proc ::tcltest::RunTest}}
# -------------------------------------------------------------------------
# cleanup
catch {namespace delete test_ns_info1 test_ns_info2}
::tcltest::cleanupTests
return
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
|
join [lrange [datal] 0 4] \n
} -result {* {type source line 723 file info.test cmd {info frame $level} proc ::etrace level 0}
* {type source line 1139 file info.test cmd etrace proc ::control}
* {type source line 1133 file info.test cmd {uplevel 1 $script} proc ::control}
* {type source line 1137 file info.test cmd control proc ::datal level 1}
* {type source line 1200 file info.test cmd datal proc ::tcltest::RunTest}}
# -------------------------------------------------------------------------
# literal sharing
test info-39.0 {location information not confused by literal sharing} -constraints tip280 -body {
namespace eval ::foo {}
proc ::foo::bar {} {
lappend res {}
lappend res [reduce [eval {info frame 0}]]
lappend res [reduce [eval {info frame 0}]]
return $res
}
set res [::foo::bar]
namespace delete ::foo
join $res \n
} -result {
type source line 1214 file info.test cmd {info frame 0} proc ::foo::bar level 0
type source line 1215 file info.test cmd {info frame 0} proc ::foo::bar level 0}
# -------------------------------------------------------------------------
# cleanup
catch {namespace delete test_ns_info1 test_ns_info2}
::tcltest::cleanupTests
return
|