@@ -61,8 +61,8 @@ test info-1.6 {info args option} {
61
61
test info-1.7 {info args option} {
62
62
catch {namespace delete test_ns_info2}
63
63
namespace eval test_ns_info2 {
64
- namespace import ::test_ns_info1::*
65
- list [info args p] [info args q]
64
+ namespace import ::test_ns_info1::*
65
+ list [info args p] [info args q]
66
66
}
67
67
} {x {y z}}
68
68
@@ -79,8 +79,8 @@ test info-2.3 {info body option} -body {
79
79
test info-2.4 {info body option} {
80
80
catch {namespace delete test_ns_info2}
81
81
namespace eval test_ns_info2 {
82
- namespace import ::test_ns_info1::*
83
- list [info body p] [info body q]
82
+ namespace import ::test_ns_info1::*
83
+ list [info body p] [info body q]
84
84
}
85
85
} {{return " x=$x " } {return " y=$y " }}
86
86
# Prior to 8.3.0 this would cause a crash because [info body]
@@ -132,7 +132,7 @@ test info-4.1 {info commands option} -body {
132
132
proc t2 {} {}
133
133
set x " [ info commands] "
134
134
list [string match {* t1 *} $x ] [string match {* t2 *} $x ] \
135
- [string match {* set *} $x ] [string match {* list *} $x ]
135
+ [string match {* set *} $x ] [string match {* list *} $x ]
136
136
} -cleanup {unset x} -result {1 1 1 1}
137
137
test info-4.2 {info commands option} -body {
138
138
proc t1 {} {}
@@ -229,8 +229,8 @@ test info-6.10 {info default option} -setup {
229
229
test info-6.11 {info default option} {
230
230
catch {namespace delete test_ns_info2}
231
231
namespace eval test_ns_info2 {
232
- namespace import ::test_ns_info1::*
233
- list [info default p x foo] $foo [info default q y bar] $bar
232
+ namespace import ::test_ns_info1::*
233
+ list [info default p x foo] $foo [info default q y bar] $bar
234
234
}
235
235
} {0 {} 1 27}
236
236
@@ -248,15 +248,15 @@ test info-7.3 {info exists option} {
248
248
} 1
249
249
test info-7.4 {info exists option} -body {
250
250
proc t1 {x} {
251
- global _nonexistent_
252
- return [info exists _nonexistent_]
251
+ global _nonexistent_
252
+ return [info exists _nonexistent_]
253
253
}
254
254
t1 2
255
255
} -setup {unset -nocomplain _nonexistent_} -result 0
256
256
test info-7.5 {info exists option} {
257
257
proc t1 {x} {
258
- set y 47
259
- return [info exists y]
258
+ set y 47
259
+ return [info exists y]
260
260
}
261
261
t1 2
262
262
} 1
@@ -284,7 +284,7 @@ test info-8.1 {info globals option} -body {
284
284
set value 23
285
285
set a " [ info globals] "
286
286
list [string match {* x *} $a ] [string match {* y *} $a ] \
287
- [string match {* value *} $a ] [string match {* _foobar_ *} $a ]
287
+ [string match {* value *} $a ] [string match {* _foobar_ *} $a ]
288
288
} -cleanup {unset x y value a} -result {1 1 1 0}
289
289
test info-8.2 {info globals option} -body {
290
290
set _xxx1 1
@@ -317,27 +317,27 @@ test info-9.1 {info level option} {
317
317
} 0
318
318
test info-9.2 {info level option} {
319
319
proc t1 {a b} {
320
- set x [info le]
321
- set y [info level 1]
322
- list $x $y
320
+ set x [info le]
321
+ set y [info level 1]
322
+ list $x $y
323
323
}
324
324
t1 146 testString
325
325
} {1 {t1 146 testString}}
326
326
test info-9.3 {info level option} {
327
327
proc t1 {a b} {
328
- t2 [expr {$a *2}] $b
328
+ t2 [expr {$a *2}] $b
329
329
}
330
330
proc t2 {x y} {
331
- list [info level] [info level 1] [info level 2] [info level -1] \
332
- [info level 0]
331
+ list [info level] [info level 1] [info level 2] [info level -1] \
332
+ [info level 0]
333
333
}
334
334
t1 146 {a {b c} {{{c}}}}
335
335
} {2 {t1 146 {a {b c} {{{c}}}}} {t2 292 {a {b c} {{{c}}}}} {t1 146 {a {b c} {{{c}}}}} {t2 292 {a {b c} {{{c}}}}}}
336
336
test info-9.4 {info level option} {
337
337
proc t1 {} {
338
- set x [info level]
339
- set y [info level 1]
340
- list $x $y
338
+ set x [info level]
339
+ set y [info level 1]
340
+ list $x $y
341
341
}
342
342
t1
343
343
} {1 t1}
@@ -406,21 +406,21 @@ test info-11.2 {info loaded option} -body {
406
406
test info-12.1 {info locals option} -body {
407
407
set a 22
408
408
proc t1 {x y} {
409
- set b 13
410
- set c testing
411
- global a
409
+ set b 13
410
+ set c testing
411
+ global a
412
412
global aa
413
413
set aa 23
414
- return [info locals]
414
+ return [info locals]
415
415
}
416
416
lsort [t1 23 24]
417
417
} -cleanup {unset a aa} -result {b c x y}
418
418
test info-12.2 {info locals option} {
419
419
proc t1 {x y} {
420
- set xx1 2
421
- set xx2 3
422
- set y 4
423
- return [info loc x*]
420
+ set xx1 2
421
+ set xx2 3
422
+ set y 4
423
+ return [info locals x*]
424
424
}
425
425
lsort [t1 2 3]
426
426
} {x xx1 xx2}
@@ -436,16 +436,16 @@ test info-12.5 {info locals option} {
436
436
} {}
437
437
test info-12.6 {info locals vs unset compiled locals} {
438
438
proc t1 {lst} {
439
- foreach $lst $lst {}
440
- unset lst
441
- return [info locals]
439
+ foreach $lst $lst {}
440
+ unset lst
441
+ return [info locals]
442
442
}
443
443
lsort [t1 {a b c c d e f}]
444
444
} {a b c d e f}
445
445
test info-12.7 {info locals with temporary variables} {
446
446
proc t1 {} {
447
- foreach a {b c} {}
448
- info locals
447
+ foreach a {b c} {}
448
+ info locals
449
449
}
450
450
t1
451
451
} {a}
@@ -475,7 +475,7 @@ test info-15.1 {info procs option} -body {
475
475
proc t2 {} {}
476
476
set x " [ info procs] "
477
477
list [string match {* t1 *} $x ] [string match {* t2 *} $x ] \
478
- [string match {* _undefined_ *} $x ]
478
+ [string match {* _undefined_ *} $x ]
479
479
} -cleanup {unset x} -result {1 1 0}
480
480
test info-15.2 {info procs option} {
481
481
proc _tt1 {} {}
@@ -491,9 +491,9 @@ test info-15.4 {info procs option} -setup {
491
491
catch {namespace delete test_ns_info2}
492
492
} -body {
493
493
namespace eval test_ns_info2 {
494
- namespace import ::test_ns_info1::*
495
- proc r {} {}
496
- list [lsort [info procs]] [info procs p*]
494
+ namespace import ::test_ns_info1::*
495
+ proc r {} {}
496
+ list [lsort [info procs]] [info procs p*]
497
497
}
498
498
} -result {{p q r} p}
499
499
test info-15.5 {info procs option with a proc in a namespace} -setup {
@@ -503,7 +503,7 @@ test info-15.5 {info procs option with a proc in a namespace} -setup {
503
503
proc p1 { arg } {
504
504
puts cmd
505
505
}
506
- proc p2 { arg } {
506
+ proc p2 { arg } {
507
507
puts cmd
508
508
}
509
509
}
@@ -516,7 +516,7 @@ test info-15.6 {info procs option with a pattern in a namespace} -setup {
516
516
proc p1 { arg } {
517
517
puts cmd
518
518
}
519
- proc p2 { arg } {
519
+ proc p2 { arg } {
520
520
puts cmd
521
521
}
522
522
}
@@ -526,7 +526,7 @@ test info-15.7 {info procs option with a global shadowing proc} -setup {
526
526
catch {namespace delete test_ns_info2}
527
527
} -body {
528
528
proc string_cmd { arg } {
529
- puts cmd
529
+ puts cmd
530
530
}
531
531
namespace eval test_ns_info2 {
532
532
proc string_cmd { arg } {
@@ -542,18 +542,18 @@ test info-15.8 {info procs option with a global shadowing proc} -setup {
542
542
catch {namespace delete test_ns_info2}
543
543
} -constraints knownBug -body {
544
544
proc string_cmd { arg } {
545
- puts cmd
545
+ puts cmd
546
546
}
547
547
proc string_cmd2 { arg } {
548
- puts cmd
548
+ puts cmd
549
549
}
550
550
namespace eval test_ns_info2 {
551
551
proc string_cmd { arg } {
552
552
puts cmd
553
553
}
554
554
}
555
555
namespace eval test_ns_info2 {
556
- lsort [info procs string*]
556
+ lsort [info procs string*]
557
557
}
558
558
} -result [lsort [list string_cmd string_cmd2]]
559
559
@@ -602,7 +602,7 @@ test info-18.1 {info tclversion option} -body {
602
602
scan [info tclversion] " %d.%d%c" a b c
603
603
} -cleanup {unset -nocomplain a b c} -result 2
604
604
test info-18.2 {info tclversion option} -body {
605
- info t 2
605
+ info tclv 2
606
606
} -returnCodes error -result {wrong # args: should be " info tclversion" }
607
607
test info-18.3 {info tclversion option} -body {
608
608
unset tcl_version
@@ -617,19 +617,19 @@ test info-19.1 {info vars option} -body {
617
617
set a 1
618
618
set b 2
619
619
proc t1 {x y} {
620
- global a b
621
- set c 33
622
- return [info vars]
620
+ global a b
621
+ set c 33
622
+ return [info vars]
623
623
}
624
624
lsort [t1 18 19]
625
625
} -cleanup {unset a b} -result {a b c x y}
626
626
test info-19.2 {info vars option} -body {
627
627
set xxx1 1
628
628
set xxx2 2
629
629
proc t1 {xxa y} {
630
- global xxx1 xxx2
631
- set c 33
632
- return [info vars x*]
630
+ global xxx1 xxx2
631
+ set c 33
632
+ return [info vars x*]
633
633
}
634
634
lsort [t1 18 19]
635
635
} -cleanup {unset xxx1 xxx2} -result {xxa xxx1 xxx2}
@@ -641,8 +641,8 @@ test info-19.4 {info vars option} -returnCodes error -body {
641
641
} -result {wrong # args: should be " info vars ?pattern?" }
642
642
test info-19.5 {info vars with temporary variables} {
643
643
proc t1 {} {
644
- foreach a {b c} {}
645
- info vars
644
+ foreach a {b c} {}
645
+ info vars
646
646
}
647
647
t1
648
648
} {a}
@@ -1599,8 +1599,8 @@ type source line 1589 file info.test cmd {info frame 0} proc ::a level 0}
1599
1599
test info-30.17 {bs+nl in multi-body switch, direct} {
1600
1600
switch -regexp -- {key } \
1601
1601
^key { reduce [info frame 0] ;# 1601 } \
1602
- \t### { } \
1603
- {[0-9]*} { }
1602
+ \t### { } \
1603
+ {[0-9]*} { }
1604
1604
} {type source line 1601 file info.test cmd {info frame 0} proc ::tcltest::RunTest}
1605
1605
1606
1606
test info-30.18 {bs+nl, literal word, uplevel through proc, appended, loss of primary tracking data} {
@@ -1642,7 +1642,7 @@ test info-30.20 {bs+nl in single-body switch, direct} {
1642
1642
^key { reduce \
1643
1643
[info frame 0] }
1644
1644
\t ### { }
1645
- {[0-9]*} { }
1645
+ {[0-9]*} { }
1646
1646
}
1647
1647
} {type source line 1643 file info.test cmd {info frame 0} proc ::tcltest::RunTest}
1648
1648
0 commit comments