Skip to content

Commit

Permalink
testutils.tcl: small efficiency improvements and some cleanup throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
1minus1is0 committed Jan 19, 2025
1 parent ee4c6ec commit 43aca22
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions tests/testutils.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ namespace eval tk {
# the whole screen.
#
proc controlPointerWarpTiming {{duration 50}} {
update idletasks ;# see a. above
if {[tk windowingsystem] eq "win32"} {
after $duration ;# see b. above
}
update idletasks ;# see a. above
if {[tk windowingsystem] eq "win32"} {
after $duration ;# see b. above
}
}

# createStdAccessProc --
Expand Down Expand Up @@ -398,7 +398,7 @@ namespace eval ::tk::test::dialog {
variable dialogType
switch -- $dialogType {
"choosedir" {
if {$parent == "."} {
if {$parent eq "."} {
set w .__tk_choosedir
} else {
set w $parent.__tk_choosedir
Expand All @@ -410,15 +410,15 @@ namespace eval ::tk::test::dialog {
upvar ::tk::dialog::color::[winfo name $w] data
}
"filebox" {
if {$parent == "."} {
if {$parent eq "."} {
set w .__tk_filedialog
} else {
set w $parent.__tk_filedialog
}
upvar ::tk::dialog::file::__tk_filedialog data
}
"msgbox" {
if {$parent == "."} {
if {$parent eq "."} {
set w .__tk__messagebox
} else {
set w $parent.__tk__messagebox
Expand All @@ -438,7 +438,7 @@ namespace eval ::tk::test::dialog {
update
}

if {$buttonType == "mouse"} {
if {$buttonType eq "mouse"} {
PressButton $button
} else {
event generate $w <Enter>
Expand Down Expand Up @@ -744,7 +744,7 @@ namespace eval ::tk::test::select {

proc setup {{path .f1} {display {}}} {
catch {destroy $path}
if {$display == {}} {
if {$display eq ""} {
frame $path
} else {
toplevel $path -screen $display
Expand All @@ -753,12 +753,11 @@ namespace eval ::tk::test::select {
selection own $path
}

#
# Create procs to be used for namespace variable access by test files
#
# Create access procs for namespace variables
foreach varName {abortCount pass selInfo selValue} {
::tk::test::createStdAccessProc $varName
}
unset varName

namespace export *
}
Expand Down

0 comments on commit 43aca22

Please sign in to comment.