summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-01-28 13:38:48 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-01-28 13:38:48 (GMT)
commite54506c166bdadcc0f3e5d2b2ff50547ca772565 (patch)
treee25bc6af895515abe50e89129c52e6b5a3c51e21
parenteba80ac0e1a2b6854d25b4b3522a5aeeb26a4725 (diff)
downloadtcl-e54506c166bdadcc0f3e5d2b2ff50547ca772565.zip
tcl-e54506c166bdadcc0f3e5d2b2ff50547ca772565.tar.gz
tcl-e54506c166bdadcc0f3e5d2b2ff50547ca772565.tar.bz2
Added test for [1109484]
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclTest.c11
-rw-r--r--tests/expr-old.test8
3 files changed, 18 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 05619b4..c8a25c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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"] \