diff options
author | hobbs <hobbs> | 2003-02-09 07:48:22 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-02-09 07:48:22 (GMT) |
commit | 3add2c1217a17f423bc67aa56379653409e05cbe (patch) | |
tree | c6933d15bed38ac3ee37519fe2b9700aeee30333 /tests | |
parent | 8c93e89f319cd8a457caaf9ac3ccdcbd850adc2f (diff) | |
download | tk-3add2c1217a17f423bc67aa56379653409e05cbe.zip tk-3add2c1217a17f423bc67aa56379653409e05cbe.tar.gz tk-3add2c1217a17f423bc67aa56379653409e05cbe.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')
-rw-r--r-- | tests/canvRect.test | 6 | ||||
-rw-r--r-- | tests/canvText.test | 4 | ||||
-rw-r--r-- | tests/canvas.test | 24 |
3 files changed, 28 insertions, 6 deletions
diff --git a/tests/canvRect.test b/tests/canvRect.test index a08679d..fafbb17 100644 --- a/tests/canvRect.test +++ b/tests/canvRect.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: canvRect.test,v 1.5 2002/07/14 05:48:46 dgp Exp $ +# RCS: @(#) $Id: canvRect.test,v 1.6 2003/02/09 07:48:22 hobbs Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -51,10 +51,10 @@ test canvRect-1.$i {configuration options} { test canvRect-2.1 {CreateRectOval procedure} { list [catch {.c create rect} msg] $msg -} {1 {wrong # args: should be ".c create rectangle x1 y1 x2 y2 ?options?"}} +} {1 {wrong # args: should be ".c create rect coords ?arg arg ...?"}} test canvRect-2.2 {CreateRectOval procedure} { list [catch {.c create oval x y z} msg] $msg -} {1 {wrong # args: should be ".c create oval x1 y1 x2 y2 ?options?"}} +} {1 {wrong # coordinates: expected 0 or 4, got 3}} test canvRect-2.3 {CreateRectOval procedure} { list [catch {.c create rectangle x 2 3 4} msg] $msg } {1 {bad screen distance "x"}} diff --git a/tests/canvText.test b/tests/canvText.test index c23f949..21f09a6 100644 --- a/tests/canvText.test +++ b/tests/canvText.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: canvText.test,v 1.11 2002/07/14 05:48:46 dgp Exp $ +# RCS: @(#) $Id: canvText.test,v 1.12 2003/02/09 07:48:22 hobbs Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -61,7 +61,7 @@ test canvText-1.$i {configuration options} { test canvText-2.1 {CreateText procedure: args} { list [catch {.c create text} msg] $msg -} {1 {wrong # args: should be ".c create text x y ?options?"}} +} {1 {wrong # args: should be ".c create text coords ?arg arg ...?"}} test canvText-2.2 {CreateText procedure: args} { list [catch {.c create text xyz 0} msg] $msg } {1 {bad screen distance "xyz"}} 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 |