summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-05-08 14:44:43 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-05-08 14:44:43 (GMT)
commit30487c02821b30ae9136fd2f83ad69418130aa9c (patch)
treede3009222c9d51c08191923c97dfc7d70c69efc1 /tests/ttk
parentccd9d0da0d8c66ba25b5a49a4f5d0d77c83408d7 (diff)
downloadtk-30487c02821b30ae9136fd2f83ad69418130aa9c.zip
tk-30487c02821b30ae9136fd2f83ad69418130aa9c.tar.gz
tk-30487c02821b30ae9136fd2f83ad69418130aa9c.tar.bz2
Add test treetags-1.11 testing [.tree tag delete]. Also remove old proc in since Tcl features this operator natively. By Emiliano Gavilan.
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/treetags.test11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/ttk/treetags.test b/tests/ttk/treetags.test
index 09c34e0..fd3a0c5 100644
--- a/tests/ttk/treetags.test
+++ b/tests/ttk/treetags.test
@@ -11,12 +11,11 @@ proc assert {expr {message ""}} {
error "PANIC: $message ($expr failed)"
}
}
-proc in {e l} { expr {[lsearch -exact $l $e] >= 0} }
proc itemConstraints {tv item} {
# $tag in [$tv item $item -tags] <==> [$tv tag has $tag $item]
foreach tag [$tv item $item -tags] {
- assert {[in $item [$tv tag has $tag]]}
+ assert {$item in [$tv tag has $tag]}
}
foreach child [$tv children $item] {
itemConstraints $tv $child
@@ -28,7 +27,7 @@ proc treeConstraints {tv} {
#
foreach tag [$tv tag names] {
foreach item [$tv tag has $tag] {
- assert {[in $tag [$tv item $item -tags]]}
+ assert {$tag in [$tv item $item -tags]}
}
}
@@ -114,6 +113,12 @@ test treetags-1.10 "tag names - tag configured" -body {
lsort [$tv tag names]
} -result [list tag1 tag2 tag3 tag4 tag5]
+test treetags-1.11 "tag delete" -body {
+ $tv tag delete tag5
+ $tv tag delete tag4
+ lsort [$tv tag names]
+} -result [list tag1 tag2 tag3]
+
test treetags-1.end "cleanup" -body {
$tv item item1 -tags tag1
$tv item item2 -tags tag2