diff options
author | hobbs <hobbs> | 2003-02-09 07:48:22 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-02-09 07:48:22 (GMT) |
commit | 9d1525754196bc3da08fd80f693f7cd24c50ab10 (patch) | |
tree | c6933d15bed38ac3ee37519fe2b9700aeee30333 /tests/canvas.test | |
parent | d3f940de47f1e49a943a67d56fa64aaa543bd4bc (diff) | |
download | tk-9d1525754196bc3da08fd80f693f7cd24c50ab10.zip tk-9d1525754196bc3da08fd80f693f7cd24c50ab10.tar.gz tk-9d1525754196bc3da08fd80f693f7cd24c50ab10.tar.bz2 |
* generic/tkCanvArc.c (CreateArc): Rework canvas create item
* generic/tkCanvBmap.c (CreateBitmap): type coords handling to be
* generic/tkCanvImg.c (CreateImage): consistent across types
* generic/tkCanvPoly.c (CreatePolygon): and not pass empty coords
* generic/tkCanvLine.c (CreateLine): to item creation procs.
* generic/tkCanvText.c (CreateText):
* generic/tkCanvWind.c (CreateWinItem):
* generic/tkCanvas.c (CanvasWidgetCmd CANV_CREATE):
* generic/tkRectOval.c (CreateRectOval):
* tests/canvRect.test:
* tests/canvText.test:
* tests/canvas.test:
Diffstat (limited to 'tests/canvas.test')
-rw-r--r-- | tests/canvas.test | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/canvas.test b/tests/canvas.test index d8df53a..ed470f9 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-2000 Ajuba Solutions. # All rights reserved. # -# RCS: @(#) $Id: canvas.test,v 1.15 2002/07/24 19:41:38 hobbs Exp $ +# RCS: @(#) $Id: canvas.test,v 1.16 2003/02/09 07:48:22 hobbs Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -452,6 +452,28 @@ test canvas-14.6 {canvas scan} { list [catch {.c scan dragto 10 10 5} msg] $msg } {0 {}} +set i 0 +proc create {w type args} { + eval [list $w create $type] $args +} +foreach type {arc bitmap image line oval polygon rect text window} { + test canvas-15.[incr i] "basic types check: $type" { + destroy .c; canvas .c + list [catch {.c create $type} msg] $msg + } [format {1 {wrong # args: should be ".c create %s coords ?arg arg ...?"}} $type] + test canvas-15.[incr i] "basic coords check: $type" { + destroy .c; canvas .c + list [catch {.c create $type 0} msg] \ + [string match "wrong # coordinates: expected*" $msg] + } {1 1} +} + +test canvas-16.1 {arc coords check} { + destroy .c; canvas .c + set id [.c create arc {0 10 20 30} -start 33] + .c itemcget $id -start +} {33.0} + destroy .c # cleanup |