Skip to content

Commit 43aca22

Browse files
committed
testutils.tcl: small efficiency improvements and some cleanup throughout
1 parent ee4c6ec commit 43aca22

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

tests/testutils.tcl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ namespace eval tk {
9090
# the whole screen.
9191
#
9292
proc controlPointerWarpTiming {{duration 50}} {
93-
update idletasks ;# see a. above
94-
if {[tk windowingsystem] eq "win32"} {
95-
after $duration ;# see b. above
96-
}
93+
update idletasks ;# see a. above
94+
if {[tk windowingsystem] eq "win32"} {
95+
after $duration ;# see b. above
96+
}
9797
}
9898

9999
# createStdAccessProc --
@@ -398,7 +398,7 @@ namespace eval ::tk::test::dialog {
398398
variable dialogType
399399
switch -- $dialogType {
400400
"choosedir" {
401-
if {$parent == "."} {
401+
if {$parent eq "."} {
402402
set w .__tk_choosedir
403403
} else {
404404
set w $parent.__tk_choosedir
@@ -410,15 +410,15 @@ namespace eval ::tk::test::dialog {
410410
upvar ::tk::dialog::color::[winfo name $w] data
411411
}
412412
"filebox" {
413-
if {$parent == "."} {
413+
if {$parent eq "."} {
414414
set w .__tk_filedialog
415415
} else {
416416
set w $parent.__tk_filedialog
417417
}
418418
upvar ::tk::dialog::file::__tk_filedialog data
419419
}
420420
"msgbox" {
421-
if {$parent == "."} {
421+
if {$parent eq "."} {
422422
set w .__tk__messagebox
423423
} else {
424424
set w $parent.__tk__messagebox
@@ -438,7 +438,7 @@ namespace eval ::tk::test::dialog {
438438
update
439439
}
440440

441-
if {$buttonType == "mouse"} {
441+
if {$buttonType eq "mouse"} {
442442
PressButton $button
443443
} else {
444444
event generate $w <Enter>
@@ -744,7 +744,7 @@ namespace eval ::tk::test::select {
744744

745745
proc setup {{path .f1} {display {}}} {
746746
catch {destroy $path}
747-
if {$display == {}} {
747+
if {$display eq ""} {
748748
frame $path
749749
} else {
750750
toplevel $path -screen $display
@@ -753,12 +753,11 @@ namespace eval ::tk::test::select {
753753
selection own $path
754754
}
755755

756-
#
757-
# Create procs to be used for namespace variable access by test files
758-
#
756+
# Create access procs for namespace variables
759757
foreach varName {abortCount pass selInfo selValue} {
760758
::tk::test::createStdAccessProc $varName
761759
}
760+
unset varName
762761

763762
namespace export *
764763
}

0 commit comments

Comments
 (0)