summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-19 22:02:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-19 22:02:27 (GMT)
commita2432ecdb54d15171a3f5f403048743e09305ea5 (patch)
treeb8e8b1d997641efd3d9cd91df45d55345336285e /tests
parent450aa9743dee157400ca5b3227922914f1c434a0 (diff)
downloadtk-a2432ecdb54d15171a3f5f403048743e09305ea5.zip
tk-a2432ecdb54d15171a3f5f403048743e09305ea5.tar.gz
tk-a2432ecdb54d15171a3f5f403048743e09305ea5.tar.bz2
Rename "yupdate" to "sync" and fix various test-cases
Diffstat (limited to 'tests')
-rw-r--r--tests/text.test42
-rw-r--r--tests/textDisp.test20
2 files changed, 31 insertions, 31 deletions
diff --git a/tests/text.test b/tests/text.test
index 7e754e2..3532546 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -153,7 +153,7 @@ test text-3.1 {TextWidgetCmd procedure, basics} {
} {1 {wrong # args: should be ".t option ?arg arg ...?"}}
test text-3.2 {TextWidgetCmd procedure} {
list [catch {.t gorp 1.0 z 1.2} msg] $msg
-} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}}
+} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}}
test text-4.1 {TextWidgetCmd procedure, "bbox" option} {
list [catch {.t bbox} msg] $msg
@@ -221,7 +221,7 @@ test text-6.13 {TextWidgetCmd procedure, "compare" option} {
} {1 {bad comparison operator "z": must be <, <=, ==, >=, >, or !=}}
test text-6.14 {TextWidgetCmd procedure, "compare" option} {
list [catch {.t co 1.0 z 1.2} msg] $msg
-} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}}
+} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}}
# "configure" option is already covered above
@@ -230,7 +230,7 @@ test text-7.1 {TextWidgetCmd procedure, "debug" option} {
} {1 {wrong # args: should be ".t debug boolean"}}
test text-7.2 {TextWidgetCmd procedure, "debug" option} {
list [catch {.t de 0 1} msg] $msg
-} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}}
+} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}}
test text-7.3 {TextWidgetCmd procedure, "debug" option} {
.t debug true
.t deb
@@ -901,7 +901,7 @@ test text-10.2 {TextWidgetCmd procedure, "index" option} {
} {1 {wrong # args: should be ".t index index"}}
test text-10.3 {TextWidgetCmd procedure, "index" option} {
list [catch {.t in a b} msg] $msg
-} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}}
+} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}}
test text-10.4 {TextWidgetCmd procedure, "index" option} {
list [catch {.t index @xyz} msg] $msg
} {1 {bad text index "@xyz"}}
@@ -960,12 +960,12 @@ test text-11.10 {TextWidgetCmd procedure, "insert" option} {
list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges silly]
} {{First second} {1.0 1.5} {1.5 1.12}}
-test text-11a.1 {TextWidgetCmd procedure, "yupdate" option} {
+test text-11a.1 {TextWidgetCmd procedure, "sync" option} {
destroy .yt
text .yt
- list [catch {.yt yupdate mytext} msg] $msg
-} {1 {wrong # args: should be ".yt yupdate"}}
-test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} {
+ list [catch {.yt sync mytext} msg] $msg
+} {1 {wrong # args: should be ".yt sync ?-command command?"}}
+test text-11a.2 {TextWidgetCmd procedure, "sync" option} {
destroy .top.yt .top
toplevel .top
pack [text .top.yt]
@@ -976,7 +976,7 @@ test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} {
.top.yt insert 1.0 $content
# wait for end of line metrics calculation to get correct $fraction1
# as a reference
- .top.yt yupdate
+ .top.yt sync
.top.yt yview moveto 1
set fraction1 [lindex [.top.yt yview] 0]
set res [expr {$fraction1 > 0}]
@@ -989,17 +989,17 @@ test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} {
# second case: wait for completion of line metrics calculation
.top.yt delete 1.0 end
.top.yt insert 1.0 $content
- .top.yt yupdate
+ .top.yt sync
.top.yt yview moveto $fraction1
set fraction2 [lindex [.top.yt yview] 0]
lappend res [expr {$fraction1 == $fraction2}]
} {1 0 1}
-test text-11a.11 {TextWidgetCmd procedure, "pendingyupdate" option} {
+test text-11a.11 {TextWidgetCmd procedure, "pendingsync" option} {
destroy .yt
text .yt
- list [catch {.yt pendingyupdate mytext} msg] $msg
-} {1 {wrong # args: should be ".yt pendingyupdate"}}
-test text-11a.12 {TextWidgetCmd procedure, "pendingyupdate" option} {
+ list [catch {.yt pendingsync mytext} msg] $msg
+} {1 {wrong # args: should be ".yt pendingsync"}}
+test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} {
destroy .top.yt .top
toplevel .top
pack [text .top.yt]
@@ -1011,21 +1011,21 @@ test text-11a.12 {TextWidgetCmd procedure, "pendingyupdate" option} {
update
# wait for end of line metrics calculation to get correct $fraction1
# as a reference
- while {[.top.yt pendingyupdate]} {update}
+ while {[.top.yt pendingsync]} {update}
.top.yt yview moveto 1
set fraction1 [lindex [.top.yt yview] 0]
set res [expr {$fraction1 > 0}]
.top.yt delete 1.0 end
.top.yt insert 1.0 $content
# ensure the test is relevant
- lappend res [expr {[.top.yt pendingyupdate] > 0}]
+ lappend res [expr {[.top.yt pendingsync] > 0}]
# asynchronously wait for completion of line metrics calculation
- while {[.top.yt pendingyupdate]} {update}
+ while {[.top.yt pendingsync]} {update}
.top.yt yview moveto $fraction1
set fraction2 [lindex [.top.yt yview] 0]
lappend res [expr {$fraction1 == $fraction2}]
} {1 1 1}
-test text-11a.21 {"<<TextLineHeightsInvalid>>" event} {
+test text-11a.21 {"<<WidgetViewSync>>" event} {
destroy .top.yt .top
toplevel .top
pack [text .top.yt]
@@ -1035,10 +1035,10 @@ test text-11a.21 {"<<TextLineHeightsInvalid>>" event} {
}
.top.yt insert 1.0 $content
update
- bind .top.yt <<TextLineHeightsInvalid>> { if {%d == 0} {set yud(%W) 1} }
+ bind .top.yt <<WidgetViewSync>> { if {%d == 0} {set yud(%W) 1} }
# wait for end of line metrics calculation to get correct $fraction1
# as a reference
- if {[.top.yt pendingyupdate]} {vwait yud(.top.yt)}
+ if {[.top.yt pendingsync]} {vwait yud(.top.yt)}
.top.yt yview moveto 1
set fraction1 [lindex [.top.yt yview] 0]
set res [expr {$fraction1 > 0}]
@@ -1047,7 +1047,7 @@ test text-11a.21 {"<<TextLineHeightsInvalid>>" event} {
# synchronously wait for completion of line metrics calculation
# and ensure the test is relevant
set waited 0
- if {[.top.yt pendingyupdate]} {set waited 1 ; vwait yud(.top.yt)}
+ if {[.top.yt pendingsync]} {set waited 1 ; vwait yud(.top.yt)}
lappend res $waited
.top.yt yview moveto $fraction1
set fraction2 [lindex [.top.yt yview] 0]
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 133fcf5..80bdb9d 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -4175,9 +4175,9 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
set ge [winfo geometry .]
scan $ge "%dx%d+%d+%d" width height left top
update
- .t1 yupdate
+ .t1 sync
set negative 0
- bind .t1 <<TextLineHeightsInvalid>> { if {%d < 0} {set negative 1} }
+ bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} }
# Without the fix for bug 2677890, changing the width of the toplevel
# will launch recomputation of the line heights, but will produce negative
# number of still remaining outdated lines, which is obviously wrong.
@@ -4185,33 +4185,33 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
# i.e. to check that the fix for this bug really is still in.
wm geometry . "[expr {$width * 2}]x$height+$left+$top"
update
- .t1 yupdate
+ .t1 sync
set negative
} -cleanup {
destroy .t1
} -result {0}
-test textDisp-34.2 {text yupdate syntax} -body {
+test textDisp-34.2 {text sync syntax} -body {
} -body {
pack [text .t1] -expand 1 -fill both
- .t1 yupdate foo
+ .t1 sync foo
} -cleanup {
destroy .t1
-} -returnCodes 1 -result {wrong # args: should be ".t1 yupdate ?-command command?"}
+} -returnCodes 1 -result {wrong # args: should be ".t1 sync ?-command command?"}
-test textDisp-34.3 {text yupdate syntax} -body {
+test textDisp-34.3 {text sync syntax} -body {
} -body {
pack [text .t1] -expand 1 -fill both
- .t1 yupdate -comx foo
+ .t1 sync -comx foo
} -cleanup {
destroy .t1
} -returnCodes 1 -result {wrong option "-comx": should be "-command"}
-test textDisp-34.4 {text yupdate syntax} -body {
+test textDisp-34.4 {text sync syntax} -body {
} -body {
set ::x 0
pack [text .t1] -expand 1 -fill both
- .t1 yupdate -comm [list set ::x 1]
+ .t1 sync -comm [list set ::x 1]
set ::x
} -cleanup {
destroy .t1