summaryrefslogtreecommitdiffstats
path: root/tests/expr-old.test
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2002-07-26 18:51:01 (GMT)
committermsofer <msofer@noemail.net>2002-07-26 18:51:01 (GMT)
commit75b5903a1e0f232bc6d3819153e49aff1c0ef4ff (patch)
tree874c4d3501b75468da85ade45821a4a28a653c51 /tests/expr-old.test
parentffdb12183be77a6e6fda5e9989d07fd829f573a6 (diff)
downloadtcl-75b5903a1e0f232bc6d3819153e49aff1c0ef4ff.zip
tcl-75b5903a1e0f232bc6d3819153e49aff1c0ef4ff.tar.gz
tcl-75b5903a1e0f232bc6d3819153e49aff1c0ef4ff.tar.bz2
* generic/tclExecute.c:
* tests/expr-old.test: fix for erroneous error messages in [expr], [Bug 587140] reported by Martin Lemburg. FossilOrigin-Name: fd76c6306b00d3fb20ce0629ba2d786a0a90ec38
Diffstat (limited to 'tests/expr-old.test')
-rw-r--r--tests/expr-old.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/expr-old.test b/tests/expr-old.test
index 3cf9959..a90366e 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.14 2002/04/18 13:04:20 msofer Exp $
+# RCS: @(#) $Id: expr-old.test,v 1.15 2002/07/26 18:51:02 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -941,6 +941,28 @@ test expr-old-36.11 {ExprLooksLikeInt procedure} {
list [catch {expr {$x+1}} msg] $msg
} {1 {can't use integer value too large to represent as operand of "+"}}
+# tests for [Bug #587140]
+test expr-old-36.12 {ExprLooksLikeInt procedure} {
+ set x "10;"
+ list [catch {expr {$x+1}} msg] $msg
+} {1 {can't use non-numeric string as operand of "+"}}
+test expr-old-36.13 {ExprLooksLikeInt procedure} {
+ set x " +"
+ list [catch {expr {$x+1}} msg] $msg
+} {1 {can't use non-numeric string as operand of "+"}}
+test expr-old-36.14 {ExprLooksLikeInt procedure} {
+ set x "123456789012345678901234567890 "
+ list [catch {expr {$x+1}} msg] $msg
+} {1 {can't use integer value too large to represent as operand of "+"}}
+test expr-old-36.15 {ExprLooksLikeInt procedure} {
+ set x "099 "
+ list [catch {expr {$x+1}} msg] $msg
+} {1 {can't use invalid octal number as operand of "+"}}
+test expr-old-36.16 {ExprLooksLikeInt procedure} {
+ set x " 0xffffffffffffffffffffffffffffffffffffff "
+ list [catch {expr {$x+1}} msg] $msg
+} {1 {can't use integer value too large to represent as operand of "+"}}
+
if {[info commands testexprlong] == {}} {
puts "This application hasn't been compiled with the \"testexprlong\""
puts "command, so I can't test Tcl_ExprLong etc."