summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-10-01 00:09:23 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-10-01 00:09:23 (GMT)
commite8d28520fa0dfb193f7825e31cb43adabfbf82ff (patch)
tree29883d6841add9eb52a2bfe24b743414966e679e
parentbbcfb76ec591e0c23230e76757184d55a0e1e238 (diff)
downloadtk-e8d28520fa0dfb193f7825e31cb43adabfbf82ff.zip
tk-e8d28520fa0dfb193f7825e31cb43adabfbf82ff.tar.gz
tk-e8d28520fa0dfb193f7825e31cb43adabfbf82ff.tar.bz2
Minor improvements
-rw-r--r--tests/canvMoveto.test56
1 files changed, 25 insertions, 31 deletions
diff --git a/tests/canvMoveto.test b/tests/canvMoveto.test
index 255df99..cdf2a04 100644
--- a/tests/canvMoveto.test
+++ b/tests/canvMoveto.test
@@ -1,57 +1,47 @@
-# This file is a Tcl script to test out the canvas "moveto" command.
-#
-# this file is derived from canvRect.test, which contains the
-# following copyright notices:
+# This file is a Tcl script to test out the canvas "moveto" command. It is
+# derived from canvRect.test.
#
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 2004 Neil McKay.
# All rights reserved.
#
-# RCS: @(#) $Id: canvMoveto.test,v 1.1 2008/09/30 23:54:46 dkf Exp $
+# RCS: @(#) $Id: canvMoveto.test,v 1.2 2008/10/01 00:09:23 dkf Exp $
package require tcltest 2.1
eval tcltest::configure $argv
tcltest::loadTestedCommands
canvas .c -width 400 -height 300 -bd 2 -relief sunken
-pack .c
-bind .c <1> {
- puts "button down at (%x,%y)"
-}
-update
-
.c create rectangle 20 20 80 80 -tag {test rect1}
.c create rectangle 40 40 90 100 -tag {test rect2}
-test canvMoveto-1.1 {Bad args handling for "moveto" command} {
- list [catch {.c moveto test} msg] $msg
-} {1 {wrong # args: should be ".c moveto tagOrId x y"}}
-test canvMoveto-1.2 {Bad args handling for "moveto" command} {
- list [catch {.c moveto rect} msg] $msg
-} {1 {wrong # args: should be ".c moveto tagOrId x y"}}
-test canvMoveto-1.3 {Bad args handling for "moveto" command} {
- list [catch {.c moveto test 12} msg] $msg
-} {1 {wrong # args: should be ".c moveto tagOrId x y"}}
-test canvMoveto-1.4 {Bad args handling for "moveto" command} {
- list [catch {.c moveto test 12 y} msg] $msg
-} {1 {bad screen distance "y"}}
-test canvMoveto-1.5 {Bad args handling for "moveto" command} {
- list [catch {.c moveto test 12 20 -anchor} msg] $msg
-} {1 {wrong # args: should be ".c moveto tagOrId x y"}}
+test canvMoveto-1.1 {Bad args handling for "moveto" command} -body {
+ .c moveto test
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+test canvMoveto-1.2 {Bad args handling for "moveto" command} -body {
+ .c moveto rect
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+test canvMoveto-1.3 {Bad args handling for "moveto" command} -body {
+ .c moveto test 12
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+test canvMoveto-1.4 {Bad args handling for "moveto" command} -body {
+ .c moveto test 12 y
+} -returnCodes error -result {bad screen distance "y"}
+test canvMoveto-1.5 {Bad args handling for "moveto" command} -body {
+ .c moveto test 12 20 -anchor
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
test canvMoveto-2.1 {Canvas "moveto" command coordinates} {
.c moveto test 200 150
.c bbox test
} {200 150 272 232}
-
-
-test canvMoveto-3.1 {Canvas "moveto" command blank y coordinate} {
+test canvMoveto-2.2 {Canvas "moveto" command, blank y coordinate} {
.c moveto test 200 150
.c moveto test 150 {}
.c bbox test
} {150 150 222 232}
-
-test canvMoveto-3.2 {Canvas "moveto" command blank x coordinate} {
+test canvMoveto-2.3 {Canvas "moveto" command, blank x coordinate} {
.c moveto test 200 150
.c moveto test {} 200
.c bbox test
@@ -62,3 +52,7 @@ test canvMoveto-3.2 {Canvas "moveto" command blank x coordinate} {
# cleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: