summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-05-24 08:46:04 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-05-24 08:46:04 (GMT)
commitad1ded4a7f409e06bd6e1b33da463e6c7cd844af (patch)
treec61968e6cab981d9a1f3f06957c8a04d2c67ddfb /tests
parent5a5048886596a6874877e5c98ccf9fac7576f3dd (diff)
parent4967e9c77f3209c4b99b21208c55d527a5a74799 (diff)
downloadtk-ad1ded4a7f409e06bd6e1b33da463e6c7cd844af.zip
tk-ad1ded4a7f409e06bd6e1b33da463e6c7cd844af.tar.gz
tk-ad1ded4a7f409e06bd6e1b33da463e6c7cd844af.tar.bz2
Merge implementation of TIP #574 following acceptation by vote.
Diffstat (limited to 'tests')
-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