summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrischan <krischan>2002-12-28 21:18:46 (GMT)
committerkrischan <krischan>2002-12-28 21:18:46 (GMT)
commit153fed3a4f25a3611ecba639e67f7fc8a5c87a36 (patch)
tree334849a4aef7fb6f7d3fe3039d2fa86bc4614f1e
parent76cee8ecb9a42cd901ac1533b9dff7999d92b73c (diff)
downloadtktreectrl-153fed3a4f25a3611ecba639e67f7fc8a5c87a36.zip
tktreectrl-153fed3a4f25a3611ecba639e67f7fc8a5c87a36.tar.gz
tktreectrl-153fed3a4f25a3611ecba639e67f7fc8a5c87a36.tar.bz2
Added tests of dragimage widget command.
-rw-r--r--tests/treectrl.test62
1 files changed, 61 insertions, 1 deletions
diff --git a/tests/treectrl.test b/tests/treectrl.test
index 2793fbc..3c8c754 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.8 2002/12/28 19:48:49 krischan Exp $
+# RCS: @(#) $Id: treectrl.test,v 1.9 2002/12/28 21:18:46 krischan Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -2127,6 +2127,66 @@ test tree-15.11 {identify: item (to the right)} -body {
.t identify 210 10
} -result {item 1 column 2}
+test tree-16.1 {dragimage: missing args} -body {
+ .t dragimage
+} -returnCodes error -result {wrong # args: should be ".t dragimage command ?arg arg...?"}
+
+test tree-16.2 {dragimage: unknown command} -body {
+ .t dragimage foo
+} -returnCodes error -result {bad command "foo": must be add, cget, clear, configure, offset, or visible}
+
+test tree-16.3 {dragimage configure} -body {
+ .t dragimage configure
+} -result {{-visible {} {} 0 0}}
+
+test tree-16.4 {dragimage configure -visible} -body {
+ .t dragimage configure -visible
+} -result {-visible {} {} 0 0}
+
+test tree-16.5 {dragimage cget -visible} -constraints knownBug -body {
+ .t dragimage cget -visible
+} -result {0}
+
+test tree-16.6 {dragimage offset: without preceding add} -body {
+ .t dragimage offset
+} -result {0 0}
+
+test tree-16.7 {dragimage add: invalid item} -body {
+ .t dragimage add foo
+} -returnCodes error -result {bad item description "foo"}
+
+test tree-16.8 {dragimage add: invalid column} -body {
+ .t dragimage add 1 foo
+} -returnCodes error -result {column with tag "foo" doesn't exist}
+
+test tree-16.9 {dragimage add: invalid element} -body {
+ .t dragimage add 1 2 foo
+} -returnCodes error -result {element "foo" doesn't exist}
+
+test tree-16.10 {dragimage add: is still not visible} -body {
+ .t dragimage add 1 2
+ .t dragimage visible
+} -result {0}
+
+test tree-16.11 {dragimage visible} -body {
+ .t dragimage visible 1
+ .t dragimage cget -visible
+} -result {1}
+
+test tree-16.12 {dragimage offset} -body {
+ .t dragimage offset 10 10
+ .t dragimage offset
+} -result {10 10}
+
+test tree-16.13 {dragimage clear: too many args} -constraints knownBug -body {
+ .t dragimage clear 1
+} -returnCodes error -result {wrong # args: should be ".t dragimage clear"}
+
+test tree-16.14 {dragimage clear: doesn't modify the offset} -body {
+ .t dragimage clear
+ .t dragimage offset
+} -result {10 10}
+
# cleanup
image delete emptyImg
::tcltest::cleanupTests