diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | generic/tclTest.c | 11 | ||||
-rw-r--r-- | tests/expr-old.test | 8 |
3 files changed, 18 insertions, 5 deletions
@@ -1,3 +1,7 @@ +2005-01-28 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * tests/expr-old.test (expr-old-37.2): Added test for [Bug 1109484] + 2005-01-27 Jeff Hobbs <jeffh@ActiveState.com> * generic/tclBasic.c (Tcl_ExprBoolean, Tcl_ExprDouble) diff --git a/generic/tclTest.c b/generic/tclTest.c index 72c8cef..cb3a314 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.87 2004/12/15 20:44:43 msofer Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.88 2005/01/28 13:38:57 dkf Exp $ */ #define TCL_TEST @@ -2277,9 +2277,14 @@ TestexprlongCmd(clientData, interp, argc, argv) long exprResult; char buf[4 + TCL_INTEGER_SPACE]; int result; - + + if (argc != 2) { + Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], + " expression\"", (char *) NULL); + return TCL_ERROR; + } Tcl_SetResult(interp, "This is a result", TCL_STATIC); - result = Tcl_ExprLong(interp, "4+1", &exprResult); + result = Tcl_ExprLong(interp, argv[1], &exprResult); if (result != TCL_OK) { return result; } diff --git a/tests/expr-old.test b/tests/expr-old.test index c531f3b..4f12a33 100644 --- a/tests/expr-old.test +++ b/tests/expr-old.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: expr-old.test,v 1.22 2004/11/03 22:12:51 dgp Exp $ +# RCS: @(#) $Id: expr-old.test,v 1.23 2005/01/28 13:38:59 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 @@ -961,8 +961,12 @@ testConstraint testexprlong [llength [info commands testexprlong]] testConstraint testexprstring [llength [info commands testexprstring]] test expr-old-37.1 {Check that Tcl_ExprLong doesn't modify interpreter result if no error} testexprlong { - testexprlong + testexprlong 4+1 } {This is a result: 5} +#Check for [Bug 1109484] +test expr-old-37.2 {Tcl_ExprLong handles wide ints gracefully} testexprlong { + testexprlong wide(1)+2 +} {This is a result: 3} test expr-old-38.1 {Verify Tcl_ExprString's basic operation} testexprstring { list [testexprstring "1+4"] [testexprstring "2*3+4.2"] \ |