diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-22 08:54:22 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-22 08:54:22 (GMT) |
commit | 20a005ef0c7ab42b7f4f703572c56ac2af790137 (patch) | |
tree | 295f11b07b62234a45581c7e7e7d58a8a02c01d3 /tests/bind.test | |
parent | 371daa9f78b7f888ce06ec270477e2dc174a54a1 (diff) | |
parent | 8e65c4de1acc5309017fcc308dc64b435509e719 (diff) | |
download | tk-20a005ef0c7ab42b7f4f703572c56ac2af790137.zip tk-20a005ef0c7ab42b7f4f703572c56ac2af790137.tar.gz tk-20a005ef0c7ab42b7f4f703572c56ac2af790137.tar.bz2 |
Merge trunk
Diffstat (limited to 'tests/bind.test')
-rw-r--r-- | tests/bind.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/bind.test b/tests/bind.test index 1b01685..c657dd5 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -6743,11 +6743,13 @@ test bind-34.1 {-warp works relatively to a window} -setup { update event generate .top <Motion> -x 20 -y 20 -warp 1 update idletasks ; # DoWarp is an idle callback + after 50 ; # Win specific - wait for SendInput to be executed set pointerPos1 [winfo pointerxy .t] wm geometry .top +600+600 update event generate .top <Motion> -x 20 -y 20 -warp 1 update idletasks ; # DoWarp is an idle callback + after 50 ; # Win specific - wait for SendInput to be executed set pointerPos2 [winfo pointerxy .t] # from the first warped position to the second one, the mouse # pointer should have moved the same amount as the window moved @@ -6766,12 +6768,33 @@ test bind-34.2 {-warp works relatively to the screen} -setup { # Contrary to bind-34.1, we're directly checking screen coordinates event generate {} <Motion> -x 20 -y 20 -warp 1 update idletasks ; # DoWarp is an idle callback + after 50 ; # Win specific - wait for SendInput to be executed set res [winfo pointerxy .] event generate {} <Motion> -x 200 -y 200 -warp 1 update idletasks ; # DoWarp is an idle callback + after 50 ; # Win specific - wait for SendInput to be executed lappend res {*}[winfo pointerxy .] } -cleanup { } -result {20 20 200 200} +test bind-34.3 {-warp works with null or negative coordinates} -setup { +} -body { + event generate {} <Motion> -x 0 -y 0 -warp 1 + update idletasks ; # DoWarp is an idle callback + after 50 ; # Win specific - wait for SendInput to be executed + set res [winfo pointerxy .] + event generate {} <Motion> -x -1 -y -1 -warp 1 + update idletasks ; # DoWarp is an idle callback + after 50 ; # Win specific - wait for SendInput to be executed + foreach dim [winfo pointerxy .] { + if {$dim <= 0} { + lappend res ok + } else { + lappend res $dim + } + } + set res +} -cleanup { +} -result {0 0 ok ok} # cleanup cleanupTests |