From 18d837b6fa55ac5268e747b828ce4e3fa78a51ea Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 23 Sep 2018 19:57:19 +0000 Subject: Fix [874dca4873]: scrollbar-10.[12] fail on macOS --- tests/scrollbar.test | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/tests/scrollbar.test b/tests/scrollbar.test index bd14067..910c4ea 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,7 +632,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 { event on scrollbar} -constraints {win|unix} -setup { +test scrollbar-10.1.1 { event on scrollbar} -constraints {notAqua} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -646,8 +646,22 @@ test scrollbar-10.1 { event on scrollbar} -constraints {win|unix} -s } -cleanup { destroy .t .s } -result {5.0} +test scrollbar-10.1.2 { event on scrollbar} -constraints {aqua} -setup { + destroy .t .s +} -body { + pack [text .t -yscrollcommand {.s set}] -side left + for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} + pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left + update + focus -force .s + event generate .s -delta -1 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {5.0} -test scrollbar-10.2 { event on scrollbar} -constraints {win|unix} -setup { +test scrollbar-10.2.1 { event on scrollbar} -constraints {notAqua} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top @@ -661,6 +675,20 @@ test scrollbar-10.2 { event on scrollbar} -constraints {win|unix} -s } -cleanup { destroy .t .s } -result {1.4} +test scrollbar-10.2.2 { event on scrollbar} -constraints {aqua} -setup { + destroy .t .s +} -body { + pack [text .t -xscrollcommand {.s set} -wrap none] -side top + for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} + pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top + update + focus -force .s + event generate .s -delta -1 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {1.4} test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { proc destroy_scrollbar {} { -- cgit v0.12 From 92f92ea4339a5946f1fd60897bed4d43ddfe68dc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 23 Sep 2018 20:05:19 +0000 Subject: Ooops, the delta needs to be -4, not -1, in order to scroll down/right four lines/chars. --- tests/scrollbar.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 910c4ea..e4fdc0e 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -654,7 +654,7 @@ test scrollbar-10.1.2 { event on scrollbar} -constraints {aqua} -set pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left update focus -force .s - event generate .s -delta -1 + event generate .s -delta -4 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { @@ -683,7 +683,7 @@ test scrollbar-10.2.2 { event on scrollbar} -constraints {aqua} -set pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s - event generate .s -delta -1 + event generate .s -delta -4 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { -- cgit v0.12