diff options
author | fvogel <fvogelnew1@free.fr> | 2019-05-14 21:25:26 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2019-05-14 21:25:26 (GMT) |
commit | 8c5a966d5ac524f8ea4bef800ee15309123dae45 (patch) | |
tree | f599684db6e1eb537cb50fe8c1c82c6391387ab9 /tests/ttk | |
parent | 344eb81cce308ca83c385ba7d980abee349bd88f (diff) | |
download | tk-8c5a966d5ac524f8ea4bef800ee15309123dae45.zip tk-8c5a966d5ac524f8ea4bef800ee15309123dae45.tar.gz tk-8c5a966d5ac524f8ea4bef800ee15309123dae45.tar.bz2 |
Refine test treeview-8.7 by also checking that deleting an unselected item does NOT fire <<TreeviewSelect>>
Diffstat (limited to 'tests/ttk')
-rw-r--r-- | tests/ttk/treeview.test | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index ae15111..d2e09b6 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -468,17 +468,21 @@ test treeview-8.6 "Selection - <<TreeviewSelect>> on selection add" -body { set res } -result {1} -test treeview-8.7 "<<TreeviewSelect>> on item deletion" -body { +test treeview-8.7 "<<TreeviewSelect>> on selected item deletion" -body { .tv selection set {} - .tv insert "" end -id doomed -text DeadItem - .tv selection add doomed + .tv insert "" end -id selectedDoomed -text DeadItem + .tv insert "" end -id doomed -text AlsoDead + .tv selection add selectedDoomed update - bind .tv <<TreeviewSelect>> {set res 1} + bind .tv <<TreeviewSelect>> {lappend res 1} set res 0 .tv delete doomed update + set res [expr {$res == 0}] + .tv delete selectedDoomed + update set res -} -result {1} +} -result {1 1} ### NEED: more tests for see/yview/scrolling |