summaryrefslogtreecommitdiffstats
path: root/tests/item.test
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-11-18 04:42:47 (GMT)
committertreectrl <treectrl>2006-11-18 04:42:47 (GMT)
commit52ae13defd32dc5a4ab6e5ced8de6c2aad5a0a1d (patch)
treea23f3f282b20bd88f4f9fecdbab91a7d9a7b7e91 /tests/item.test
parent9ebff983b33d0b63fc56391cb5aaaee09bb38143 (diff)
downloadtktreectrl-52ae13defd32dc5a4ab6e5ced8de6c2aad5a0a1d.zip
tktreectrl-52ae13defd32dc5a4ab6e5ced8de6c2aad5a0a1d.tar.gz
tktreectrl-52ae13defd32dc5a4ab6e5ced8de6c2aad5a0a1d.tar.bz2
Added tests of improved [item count].
Diffstat (limited to 'tests/item.test')
-rw-r--r--tests/item.test40
1 files changed, 39 insertions, 1 deletions
diff --git a/tests/item.test b/tests/item.test
index 71641d8..d9ed14b 100644
--- a/tests/item.test
+++ b/tests/item.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# CVS: @(#) $Id: item.test,v 1.17 2006/10/29 02:41:58 treectrl Exp $
+# CVS: @(#) $Id: item.test,v 1.18 2006/11/18 04:42:47 treectrl Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -1145,6 +1145,44 @@ test item-20.42 {item tag: [expr]} -body {
test item-20.43 {item tag: [expr]} -body {
.t item tag expr 100 e^b
+} -cleanup {
+ .t item delete all
+} -result {1}
+
+test item-21.1 {item count: too many args} -body {
+ .t item count a b
+} -returnCodes error -result {wrong # args: should be ".t item count ?itemDesc?"}
+
+test item-21.2 {item count: no args, only root} -body {
+ .t item count
+} -result {1}
+
+test item-21.2 {item count: no args, many items} -setup {
+ .t item create -count 50 -parent root
+} -body {
+ .t item count
+} -result {51}
+
+test item-21.3 {item count: double-check with range} -body {
+ expr {[.t item count] == [llength [.t item range first last]]}
+} -result {1}
+
+test item-21.4 {item count: double-check with range} -body {
+ expr {[.t item count] == [.t item count "range first last"]}
+} -result {1}
+
+test item-21.5 {item count: all is same as no args} -body {
+ expr {[.t item count] == [.t item count all]}
+} -result {1}
+
+test item-21.6 {item count: depth test} -body {
+ .t item count "depth 1"
+} -result {50}
+
+test item-21.7 {item count: double-check with selection} -setup {
+ .t selection add "range 10 20"
+} -body {
+ expr {[.t item count "state selected"] == [.t selection count]}
} -result {1}
test item-99.1 {some needed cleanup} -body {