summaryrefslogtreecommitdiffstats
path: root/tests/lindex.test
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2007-09-03 21:27:20 (GMT)
committerkennykb <kennykb@noemail.net>2007-09-03 21:27:20 (GMT)
commit2df746c920b4e0412aa1567c86aa94d1f79f0359 (patch)
tree237dbf3798cc08dc20e1d810f79420fabfdf3a59 /tests/lindex.test
parent2b567d454a20c433c882189cfc4c6275517d35a4 (diff)
downloadtcl-2df746c920b4e0412aa1567c86aa94d1f79f0359.zip
tcl-2df746c920b4e0412aa1567c86aa94d1f79f0359.tar.gz
tcl-2df746c920b4e0412aa1567c86aa94d1f79f0359.tar.bz2
* tests/lindex.test (lindex-17.[01]): Added code to detect the
error when a script does [lindex {} end foo]; an overaggressive optimisation caused this call to return an empty object rather than an error. FossilOrigin-Name: 540ed3dbdde6275cfa393d94128643b0a1066355
Diffstat (limited to 'tests/lindex.test')
-rw-r--r--tests/lindex.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/lindex.test b/tests/lindex.test
index 44ad429..37c840e 100644
--- a/tests/lindex.test
+++ b/tests/lindex.test
@@ -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: lindex.test,v 1.14 2007/01/09 11:32:35 dkf Exp $
+# RCS: @(#) $Id: lindex.test,v 1.15 2007/09/03 21:27:22 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -428,8 +428,30 @@ test lindex-16.7 {data reuse} {
set result
} {}
+test lindex-17.0 {Bug 1718580} {*}{
+ -body {
+ lindex {} end foo
+ }
+ -match glob
+ -result {bad index "foo"*}
+ -returnCodes 1
+}
+
+test lindex-17.1 {Bug 1718580} {*}{
+ -body {
+ lindex a end foo
+ }
+ -match glob
+ -result {bad index "foo"*}
+ -returnCodes 1
+}
+
catch { unset minus }
# cleanup
::tcltest::cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: