summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
commitd8f50ac067d2f0df387ca0b0c46278c2464efc8b (patch)
tree4c40167ca8b673d38459b4478944b8bc60cc4a7f /tests/ttk
parentc56ea97892bf4b5716fd0c88709b0ef0cb130995 (diff)
parenta9827f93eadc2978316098553e09406dae1f5520 (diff)
downloadtk-bug-b1d115fa60.zip
tk-bug-b1d115fa60.tar.gz
tk-bug-b1d115fa60.tar.bz2
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/entry.test3
-rw-r--r--tests/ttk/spinbox.test12
-rw-r--r--tests/ttk/validate.test33
3 files changed, 31 insertions, 17 deletions
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index 293bfe1..384f297 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -8,6 +8,7 @@ namespace import -force tcltest::*
loadTestedCommands
testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
variable scrollInfo
proc scroll args {
@@ -77,7 +78,7 @@ test entry-2.1 "Create entry before scrollbar" -body {
-expand false -fill x
} -cleanup {destroy .te .tsb}
-test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints failsOnUbuntu -body {
+test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints {failsOnUbuntu failsOnXQuarz} -body {
pack [ttk::entry .te -xscrollcommand [list .tsb set]] \
-expand true -fill both
.te insert end [string repeat "abc" 50]
diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test
index cd3b2ce..9c82cd7 100644
--- a/tests/ttk/spinbox.test
+++ b/tests/ttk/spinbox.test
@@ -127,7 +127,7 @@ test spinbox-1.8.2 "option -validate" -setup {
.sb cget -validate
} -cleanup {
destroy .sb
-} -result {none}
+} -result none
test spinbox-1.8.3 "option -validate" -setup {
ttk::spinbox .sb -from 0 -to 100
@@ -138,14 +138,18 @@ test spinbox-1.8.3 "option -validate" -setup {
} -returnCodes error -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none}
test spinbox-1.8.4 "-validate option: " -setup {
- set ::spinbox_test {}
ttk::spinbox .sb -from 0 -to 100
+ set ::spinbox_test {}
} -body {
- .sb configure -validate all -validatecommand {lappend ::spinbox_test %P}
+ .sb configure -validate all -validatecommand {set ::spinbox_test %P}
pack .sb
+ update idletasks
.sb set 50
focus -force .sb
- after 500 {set ::spinbox_wait 1} ; vwait ::spinbox_wait
+ set ::spinbox_wait 0
+ set timer [after 100 {set ::spinbox_wait 1}]
+ vwait ::spinbox_wait
+ after cancel $timer
set ::spinbox_test
} -cleanup {
destroy .sb
diff --git a/tests/ttk/validate.test b/tests/ttk/validate.test
index 5430903..61e7c2c 100644
--- a/tests/ttk/validate.test
+++ b/tests/ttk/validate.test
@@ -78,54 +78,63 @@ test validate-1.7 {entry widget validation - vmode focus} -body {
} -result {}
test validate-1.8 {entry widget validation - vmode focus} -body {
+ set ::vVals {}
+ set timer [after 300 lappend ::vVals timeout]
focus -force .e
- # update necessary to process FocusIn event
- update
+ vwait ::vVals
+ after cancel $timer
set ::vVals
} -result {.e -1 -1 abcd abcd {} focus focusin}
test validate-1.9 {entry widget validation - vmode focus} -body {
+ set ::vVals {}
+ set timer [after 300 lappend ::vVals timeout]
focus -force .
- # update necessary to process FocusOut event
- update
+ vwait ::vVals
+ after cancel $timer
set ::vVals
} -result {.e -1 -1 abcd abcd {} focus focusout}
.e configure -validate all
test validate-1.10 {entry widget validation - vmode all} -body {
+ set ::vVals {}
+ set timer [after 300 lappend ::vVals timeout]
focus -force .e
- # update necessary to process FocusIn event
- update
+ vwait ::vVals
+ after cancel $timer
set ::vVals
} -result {.e -1 -1 abcd abcd {} all focusin}
test validate-1.11 {entry widget validation} -body {
+ set ::vVals {}
+ set timer [after 300 lappend ::vVals timeout]
focus -force .
- # update necessary to process FocusOut event
- update
+ vwait ::vVals
+ after cancel $timer
set ::vVals
} -result {.e -1 -1 abcd abcd {} all focusout}
.e configure -validate focusin
test validate-1.12 {entry widget validation} -body {
+ set ::vVals {}
+ set timer [after 300 lappend ::vVals timeout]
focus -force .e
- # update necessary to process FocusIn event
- update
+ vwait ::vVals
+ after cancel $timer
set ::vVals
} -result {.e -1 -1 abcd abcd {} focusin focusin}
test validate-1.13 {entry widget validation} -body {
set ::vVals {}
focus -force .
- # update necessary to process FocusOut event
update
set ::vVals
} -result {}
.e configure -validate focuso
test validate-1.14 {entry widget validation} -body {
+ set ::vVals {}
focus -force .e
- # update necessary to process FocusIn event
update
set ::vVals
} -result {}