summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-11-09 00:15:30 (GMT)
committertreectrl <treectrl>2006-11-09 00:15:30 (GMT)
commit92daa0575c0bb2dbd7a8f082f06a4eb6fa984da1 (patch)
tree91fdb9d86ac176fb11ed240e82c8040eff434d2a
parent549d9b39bd061c7650943b0886a252661ea3e948 (diff)
downloadtktreectrl-92daa0575c0bb2dbd7a8f082f06a4eb6fa984da1.zip
tktreectrl-92daa0575c0bb2dbd7a8f082f06a4eb6fa984da1.tar.gz
tktreectrl-92daa0575c0bb2dbd7a8f082f06a4eb6fa984da1.tar.bz2
Added tests for -defaultstyle (even though it is now deprecated).
-rw-r--r--tests/treectrl.test75
1 files changed, 74 insertions, 1 deletions
diff --git a/tests/treectrl.test b/tests/treectrl.test
index 452b80c..b0680ee 100644
--- a/tests/treectrl.test
+++ b/tests/treectrl.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.
#
-# RCS: @(#) $Id: treectrl.test,v 1.31 2006/10/29 02:39:45 treectrl Exp $
+# RCS: @(#) $Id: treectrl.test,v 1.32 2006/11/09 00:15:30 treectrl Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -762,6 +762,79 @@ test treectrl-17.5 {columnproxy} -body {
.t cget -columnproxy
} -result {100}
+test treectrl-18.1 {-defaultstyle: setup} -body {
+ .t column delete all
+ .t column create -tags a
+ .t column create -tags b
+ .t column create -tags c
+ .t column create -tags d
+
+ .t item delete all
+
+ .t style create a
+ .t style create b
+ .t style create c
+ .t style create d
+} -result {d}
+
+test treectrl-18.2 {-defaultstyle: set} -constraints {
+ deprecated
+} -body {
+ .t configure -defaultstyle {a b c d}
+ .t cget -defaultstyle
+} -result {a b c d}
+
+test treectrl-18.3 {-defaultstyle: new items get default styles} -constraints {
+ deprecated
+} -body {
+ set I [.t item create]
+ .t item style set $I
+} -result {a b c d}
+
+test treectrl-18.4 {-defaultstyle: moving column updates -defaultstyle} -constraints {
+ deprecated
+} -body {
+ .t column move "tag a" "tag c"
+ .t cget -defaultstyle
+} -result {b a c d}
+
+test treectrl-18.5 {-defaultstyle: moving column updates -defaultstyle} -constraints {
+ deprecated
+} -body {
+ .t column move "tag a" tail
+ .t cget -defaultstyle
+} -result {b c d a}
+
+test treectrl-18.6 {-defaultstyle: moving column updates -defaultstyle} -constraints {
+ deprecated
+} -body {
+ .t column move "tag a" "tag b"
+ .t cget -defaultstyle
+} -result {a b c d}
+
+test treectrl-18.7 {-defaultstyle: moving column updates -defaultstyle} -constraints {
+ deprecated
+} -body {
+ .t column create -tags e
+ .t column move "tag e" "tag d"
+ .t cget -defaultstyle
+} -result {a b c {} d}
+
+test treectrl-18.8 {-defaultstyle: moving column updates -defaultstyle} -constraints {
+ deprecated
+} -body {
+ .t column create -tags f
+ .t column move "tag c" tail
+ .t cget -defaultstyle
+} -result {a b {} d {} c}
+
+test treectrl-18.9 {-defaultstyle: deleting column does not update -defaultstyle} -constraints {
+ deprecated
+} -body {
+ .t column delete "tag e"
+ .t cget -defaultstyle
+} -result {a b {} d {} c}
+
# cleanup
image delete emptyImg
::tcltest::cleanupTests