diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-10-11 06:47:25 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-10-11 06:47:25 (GMT) |
commit | d5bf077d9970af39be14c3e63f6f25dfdcb85536 (patch) | |
tree | 204c669715887f7038fa12ee7b808a62db166590 | |
parent | 90b51b262b19f7afeea69f91260f9703e2e1c322 (diff) | |
download | tk-d5bf077d9970af39be14c3e63f6f25dfdcb85536.zip tk-d5bf077d9970af39be14c3e63f6f25dfdcb85536.tar.gz tk-d5bf077d9970af39be14c3e63f6f25dfdcb85536.tar.bz2 |
Correct error result generation of [$canvas select clear $bogus].
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | generic/tkCanvas.c | 4 | ||||
-rw-r--r-- | tests/canvText.test | 10 |
3 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,7 @@ +2008-10-11 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tkCanvas.c (CanvasWidgetCmd): Corrected result generation. + 2008-10-10 Don Porter <dgp@users.sourceforge.net> *** 8.6a3 TAGGED FOR RELEASE *** diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index bc37043..97fd093 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.51 2008/09/30 23:54:46 dkf Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.52 2008/10/11 06:47:25 dkf Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -1712,7 +1712,7 @@ CanvasWidgetCmd( break; case CANV_CLEAR: if (objc != 3) { - Tcl_AppendResult(interp, 3, objv, NULL); + Tcl_WrongNumArgs(interp, 3, objv, NULL); result = TCL_ERROR; goto done; } diff --git a/tests/canvText.test b/tests/canvText.test index 533a316..96a362a 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.20 2008/10/08 16:13:42 dgp Exp $ +# RCS: @(#) $Id: canvText.test,v 1.21 2008/10/11 06:47:25 dkf Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -819,7 +819,13 @@ test canvText-14.5 {GetTextIndex procedure: bad int or unknown index} -setup { } -cleanup { .c delete test } -returnCodes {error} -result {bad index "xyz"} - +test canvText-14.6 {select clear errors} -setup { + .c create text 0 0 -tag test +} -body { + .c select clear test +} -cleanup { + .c delete test +} -returnCodes error -result "wrong \# args: should be \".c select clear\"" test canvText-15.1 {SetTextCursor procedure} -setup { .c create text 0 0 -tag test |