summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorculler <culler>2021-04-28 15:56:04 (GMT)
committerculler <culler>2021-04-28 15:56:04 (GMT)
commit4d1967bac73880c706d9c1c5b11388e97a695faa (patch)
tree4368a13a4e911fcd6da053bed0fa7188b5ad9d64 /tests
parent0512da3facc4560d40d97a359c4a1ecefbee4da5 (diff)
downloadtk-4d1967bac73880c706d9c1c5b11388e97a695faa.zip
tk-4d1967bac73880c706d9c1c5b11388e97a695faa.tar.gz
tk-4d1967bac73880c706d9c1c5b11388e97a695faa.tar.bz2
Deal with new test failures revealed by changing the order of the tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/bind.test5
-rw-r--r--tests/ttk/spinbox.test10
-rw-r--r--tests/ttk/validate.test33
3 files changed, 33 insertions, 15 deletions
diff --git a/tests/bind.test b/tests/bind.test
index 7a075fe..f653f3e 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -1052,6 +1052,7 @@ test bind-13.45 {Tk_BindEvent procedure: error in script} -setup {
test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
+ update idletasks
focus -force .t.f
update
} -body {
@@ -1068,6 +1069,7 @@ test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup {
test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
+ update idletasks
focus -force .t.f
update
} -body {
@@ -1479,6 +1481,7 @@ test bind-15.26 {MatchPatterns procedure, reject a virtual event} -setup {
test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
+ update idletasks
focus -force .t.f
update
} -body {
@@ -1493,6 +1496,7 @@ test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup {
test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
+ update idletasks
focus -force .t.f
update
} -body {
@@ -1507,6 +1511,7 @@ test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup {
test bind-15.29 {MatchPatterns procedure, conflict resolution} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
+ update idletasks
focus -force .t.f
update
} -body {
diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test
index cd3b2ce..8656d9d 100644
--- a/tests/ttk/spinbox.test
+++ b/tests/ttk/spinbox.test
@@ -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 {}