summaryrefslogtreecommitdiffstats
path: root/tests/expr-old.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-07-26 18:51:01 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-07-26 18:51:01 (GMT)
commitf63b5e89f17fa39c82ffbe4e7139a146d845f31d (patch)
tree874c4d3501b75468da85ade45821a4a28a653c51 /tests/expr-old.test
parent63204dfc87cd527e35332820b3be678f1e7eac30 (diff)
downloadtcl-f63b5e89f17fa39c82ffbe4e7139a146d845f31d.zip
tcl-f63b5e89f17fa39c82ffbe4e7139a146d845f31d.tar.gz
tcl-f63b5e89f17fa39c82ffbe4e7139a146d845f31d.tar.bz2
* generic/tclExecute.c:
* tests/expr-old.test: fix for erroneous error messages in [expr], [Bug 587140] reported by Martin Lemburg.
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."