summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-09 09:20:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-09 09:20:18 (GMT)
commit039617ba140279fe5af76656909a5c6c1c255e30 (patch)
tree65a7c0e68a7b13de8ea3afb65db569ebb85ef83c
parent5eafeee26a48a24edcf9f727ea55ccf0e22cc856 (diff)
parent99a15328fddd0c5ca9a5a1f8db86a2fc3abdfe2d (diff)
downloadtk-039617ba140279fe5af76656909a5c6c1c255e30.zip
tk-039617ba140279fe5af76656909a5c6c1c255e30.tar.gz
tk-039617ba140279fe5af76656909a5c6c1c255e30.tar.bz2
Rebase to 8.6, and use more "vwait" in stead of "update"
-rw-r--r--tests/entry.test38
-rw-r--r--tests/scale.test16
-rw-r--r--tests/spinbox.test36
-rw-r--r--tests/ttk/entry.test9
4 files changed, 74 insertions, 25 deletions
diff --git a/tests/entry.test b/tests/entry.test
index 67f8374..3c80e07 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -1671,11 +1671,13 @@ test entry-5.7 {ConfigureEntry procedure} -setup {
} -body {
.e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
.e configure -width 5
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.000000 0.363636}
@@ -1916,10 +1918,12 @@ test entry-7.1 {InsertChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 2 XXX
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abXXXcde abXXXcde {0.000000 1.000000}}
test entry-7.2 {InsertChars procedure} -setup {
@@ -1931,10 +1935,12 @@ test entry-7.2 {InsertChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 500 XXX
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
test entry-7.3 {InsertChars procedure} -setup {
entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -2063,10 +2069,12 @@ test entry-8.1 {DeleteChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 2 4
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abe abe {0.000000 1.000000}}
test entry-8.2 {DeleteChars procedure} -setup {
unset -nocomplain contents
@@ -2077,10 +2085,12 @@ test entry-8.2 {DeleteChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete -2 2
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {cde cde {0.000000 1.000000}}
test entry-8.3 {DeleteChars procedure} -setup {
unset -nocomplain contents
@@ -2091,10 +2101,12 @@ test entry-8.3 {DeleteChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 3 1000
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abc abc {0.000000 1.000000}}
test entry-8.4 {DeleteChars procedure} -setup {
entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -2927,30 +2939,36 @@ test entry-17.1 {EntryUpdateScrollbar procedure} -body {
pack .e
.e delete 0 end
.e insert 0 123
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.000000 1.000000}
test entry-17.2 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
.e insert 0 0123456789abcdef
.e xview 3
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.187500 0.812500}
test entry-17.3 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
.e insert 0 abcdefghijklmnopqrs
.e xview 6
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.315789 0.842105}
test entry-17.4 {EntryUpdateScrollbar procedure} -setup {
proc bgerror msg {
@@ -2960,7 +2978,7 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup {
} -body {
entry .e -width 5 -xscrollcommand thisisnotacommand
pack .e
- update
+ vwait x
list $x $errorInfo
} -cleanup {
destroy .e
diff --git a/tests/scale.test b/tests/scale.test
index 75293aa..38c3e9a 100644
--- a/tests/scale.test
+++ b/tests/scale.test
@@ -1478,10 +1478,12 @@ test scale-20.4 {Bug [2262543fff] - Scale widget unexpectedly fires command call
scale .s -from 1 -to 50 -command {set commandedVar}
.s set 10
pack .s
- update ; # -command callback shall fire
+ set timeout [after 500 {set $commandedVar "timeout"}]
+ vwait commandedVar ; # -command callback shall fire
set res [list [.s get] $commandedVar]
} -cleanup {
destroy .s
+ after cancel $timeout
} -result {10 10}
test scale-20.5 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 5} -setup {
catch {destroy .s}
@@ -1506,10 +1508,12 @@ test scale-20.6 {Bug [2262543fff] - Scale widget unexpectedly fires command call
pack .s
.s configure -command {set commandedVar}
.s set 10
- update ; # -command callback shall fire
+ set timeout [after 500 {set $commandedVar "timeout"}]
+ vwait commandedVar ; # -command callback shall fire
set res [list [.s get] $commandedVar]
} -cleanup {
destroy .s
+ after cancel $timeout
} -result {10 10}
test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 7} -setup {
catch {destroy .s}
@@ -1519,10 +1523,12 @@ test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command call
scale .s -from 1 -to 50 -command {set commandedVar}
pack .s
.s set 10
- update ; # -command callback shall fire
+ set timeout [after 500 {set $commandedVar "timeout"}]
+ vwait commandedVar ; # -command callback shall fire
set res [list [.s get] $commandedVar]
} -cleanup {
destroy .s
+ after cancel $timeout
} -result {10 10}
test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 8} -setup {
catch {destroy .s}
@@ -1533,10 +1539,12 @@ test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command call
scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar}
pack .s
.s set 10
- update ; # -command callback shall fire
+ set timeout [after 500 {set $commandedVar "timeout"}]
+ vwait commandedVar ; # -command callback shall fire
set res [list [.s get] $commandedVar]
} -cleanup {
destroy .s
+ after cancel $timeout
} -result {10 10}
test scale-21.1 {Bug [55b95f578a] - Associating variable with bignum value with scale crashes it} -setup {
diff --git a/tests/spinbox.test b/tests/spinbox.test
index f9e11b6..5a1cffc 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -2013,11 +2013,13 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup {
} -body {
.e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
.e configure -width 5
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.000000 0.363636}
test spinbox-5.8 {ConfigureSpinbox procedure} -constraints {
@@ -2203,10 +2205,12 @@ test spinbox-7.1 {InsertChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 2 XXX
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abXXXcde abXXXcde {0.000000 1.000000}}
test spinbox-7.2 {InsertChars procedure} -setup {
@@ -2218,10 +2222,12 @@ test spinbox-7.2 {InsertChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 500 XXX
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
test spinbox-7.3 {InsertChars procedure} -setup {
spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -2350,10 +2356,12 @@ test spinbox-8.1 {DeleteChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 2 4
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abe abe {0.000000 1.000000}}
test spinbox-8.2 {DeleteChars procedure} -setup {
unset -nocomplain contents
@@ -2364,10 +2372,12 @@ test spinbox-8.2 {DeleteChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete -2 2
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {cde cde {0.000000 1.000000}}
test spinbox-8.3 {DeleteChars procedure} -setup {
unset -nocomplain contents
@@ -2378,10 +2388,12 @@ test spinbox-8.3 {DeleteChars procedure} -setup {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 3 1000
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {abc abc {0.000000 1.000000}}
test spinbox-8.4 {DeleteChars procedure} -setup {
spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -3163,30 +3175,36 @@ test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body {
pack .e
.e delete 0 end
.e insert 0 123
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.000000 1.000000}
test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
.e insert 0 0123456789abcdef
.e xview 3
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.187500 0.812500}
test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
.e insert 0 abcdefghijklmnopqrs
.e xview 6
- update
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
+ after cancel $timeout
} -result {0.315789 0.842105}
test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup {
proc bgerror msg {
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index a920042..34795fe 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -77,9 +77,14 @@ test entry-2.1 "Create entry before scrollbar" -body {
test entry-2.2 "Initial scroll position" -body {
ttk::entry .e -font fixed -width 5 -xscrollcommand scroll
.e insert end "0123456789"
- pack .e; update
+ pack .e;
+ set timeout [after 500 {set $scrollInfo "timeout"}]
+ vwait scrollInfo
set scrollInfo
-} -result {0.0 0.5} -cleanup { destroy .e }
+} -cleanup {
+ destroy .e
+ after cancel $timeout
+} -result {0.0 0.5}
# NOTE: result can vary depending on font.
# Bounding box / scrolling tests.