393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
-
-
+
+
|
test info-10.3 {info library option} -body {
unset tcl_library
info library
} -returnCodes error -result {no library has been specified for Tcl}
set tcl_library $savedLibrary; unset savedLibrary
test info-11.1 {info loaded option} -body {
info loaded a b
} -returnCodes error -result {wrong # args: should be "info loaded ?interp?"}
info loaded a b c
} -returnCodes error -result {wrong # args: should be "info loaded ?interp? ?packageName?"}
test info-11.2 {info loaded option} -body {
info loaded {}; info loaded gorp
} -returnCodes error -result {could not find interpreter "gorp"}
test info-12.1 {info locals option} -body {
set a 22
proc t1 {x y} {
|
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
|
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
|
-
+
-
+
-
+
|
# -------------------------------------------------------------------------
namespace eval foo {}
proc foo::bar {} {
foreach {*}{
x y
{set res [info frame 0]}
}
}
return $res
}
test info-33.13 {{*}, literal, simple, bytecompiled} -body {
reduce [foo::bar]
} -cleanup {
namespace delete foo
} -result {type source line 2101 file info.test cmd {info frame 0} proc ::foo::bar level 0}
# -------------------------------------------------------------------------
namespace eval foo {}
proc foo::bar {} {
if {*}{
{[return [info frame 0]]}
{}
}
}
}
test info-33.14 {{*}, literal, simple, bytecompiled} -body {
reduce [foo::bar]
} -cleanup {
namespace delete foo
} -result {type source line 2115 file info.test cmd {info frame 0} proc ::foo::bar level 0}
# -------------------------------------------------------------------------
namespace eval foo {}
proc foo::bar {} {
if 0 {*}{
{} else
{return [info frame 0]}
}
}
}
test info-33.15 {{*}, literal, simple, bytecompiled} -body {
reduce [foo::bar]
} -cleanup {
namespace delete foo
} -result {type source line 2130 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
|
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
|
-
+
|
} -result {type source line 2218 file info.test cmd {info frame 0} proc ::foo::bar level 0}
# -------------------------------------------------------------------------
namespace eval foo {}
proc foo::bar {} {
try {*}{
{set res [info frame 0]}
}
}
return $res
}
test info-33.23 {{*}, literal, simple, bytecompiled} -body {
reduce [foo::bar]
} -cleanup {
namespace delete foo
} -result {type source line 2231 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
|
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
catch {rename bar {}}
}
} -result {0 1 ::testinfocmdtype::foo {} ::testinfocmdtype::bar 1 0}
namespace delete ::testinfocmdtype
# -------------------------------------------------------------------------
unset -nocomplain res
test info-39.2 {Bug 4b61afd660} -setup {
proc probe {} {
return [dict get [info frame -1] line]
}
set body {
set cmd probe
$cmd
}
proc demo {} $body
} -body {
demo
} -cleanup {
unset -nocomplain body
rename demo {}
rename probe {}
} -result 3
# cleanup
catch {namespace delete test_ns_info1 test_ns_info2}
::tcltest::cleanupTests
return
|