diff options
Diffstat (limited to 'tests/canvMoveto.test')
| -rw-r--r-- | tests/canvMoveto.test | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/tests/canvMoveto.test b/tests/canvMoveto.test index 1ff1a0c..d4da911 100644 --- a/tests/canvMoveto.test +++ b/tests/canvMoveto.test @@ -6,14 +6,34 @@ # Copyright © 2004 Neil McKay. # All rights reserved. -package require tcltest 2.2 -eval tcltest::configure $argv -tcltest::loadTestedCommands +# +# TESTFILE INITIALIZATION +# + +package require tcltest 2.2; # needed in mode -singleproc 0 + +# Load the main script main.tcl, which takes care of: +# - setup for the application and the root window +# - importing commands from the tcltest namespace +# - loading of the testutils mechanism along with its utility procs +# - loading of Tk specific test constraints (additionally to constraints +# provided by the package tcltest) +source [file join [tcltest::configure -testdir] main.tcl] +# Ensure a pristine initial window state +resetWindows + +# +# COMMON TEST SETUP +# canvas .c -width 400 -height 300 -bd 2 -relief sunken .c create rectangle 20 20 80 80 -tag {test rect1} .c create rectangle 40 40 90 100 -tag {test rect2} +# +# TESTS +# + 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"} @@ -45,11 +65,12 @@ test canvMoveto-2.3 {Canvas "moveto" command, blank x coordinate} { .c bbox test } {200 200 272 282} -.c delete withtag all +# +# TESTFILE CLEANUP +# -# cleanup +.c delete withtag all cleanupTests -return # Local Variables: # mode: tcl |
