diff options
author | fvogel <fvogelnew1@free.fr> | 2020-04-16 21:14:19 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-04-16 21:14:19 (GMT) |
commit | 9632444b883bc5e9fb7273102329e1a61c38cebb (patch) | |
tree | 9134880176b0b1f23abc1fd77ed5aa3171289975 | |
parent | 26f63772e7f0ec8eb1245e39ff44391cc16152a6 (diff) | |
download | tk-9632444b883bc5e9fb7273102329e1a61c38cebb.zip tk-9632444b883bc5e9fb7273102329e1a61c38cebb.tar.gz tk-9632444b883bc5e9fb7273102329e1a61c38cebb.tar.bz2 |
Add non-regression test entry-2.1.1. This test fails before the fix, and passes after the fix.
-rw-r--r-- | tests/ttk/entry.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index 8b5f490..2e5f43c 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -74,6 +74,18 @@ test entry-2.1 "Create entry before scrollbar" -body { -expand false -fill x } -cleanup {destroy .te .tsb} +test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body { + pack [ttk::entry .te -xscrollcommand [list .tsb set]] \ + -expand true -fill both + .te insert end [string repeat "abc" 50] + catch {update} ; # error triggers because the -xscrollcommand callback + # errors out: invalid command name ".tsb" + pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \ + -expand false -fill x + update ; # no error + lappend res [expr [lindex [.tsb get] 1] < 1] ; # scrollbar did update +} -result {1} -cleanup {destroy .te .tsb} + test entry-2.2 "Initial scroll position" -body { ttk::entry .e -font fixed -width 5 -xscrollcommand scroll .e insert end "0123456789" |