diff options
author | dgp <dgp@users.sourceforge.net> | 2018-03-11 12:33:16 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-03-11 12:33:16 (GMT) |
commit | c7e8d507d9233725a4629931bbceeea7ac23f699 (patch) | |
tree | cedf1bdd26675be6cadb2414a4057c19611f5868 /tests/lindex.test | |
parent | cb242c0d50a43eddaa567d50717b5367658eb934 (diff) | |
parent | e7be4a19a0cdf781b241095a0aba272ff7b35ffd (diff) | |
download | tcl-c7e8d507d9233725a4629931bbceeea7ac23f699.zip tcl-c7e8d507d9233725a4629931bbceeea7ac23f699.tar.gz tcl-c7e8d507d9233725a4629931bbceeea7ac23f699.tar.bz2 |
merge 8.7
Diffstat (limited to 'tests/lindex.test')
-rw-r--r-- | tests/lindex.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lindex.test b/tests/lindex.test index 4802e28..9de08c1 100644 --- a/tests/lindex.test +++ b/tests/lindex.test @@ -79,6 +79,15 @@ test lindex-3.7 {indexes don't shimmer wide ints} { set x [expr {(wide(1)<<31) - 2}] list $x [lindex {1 2 3} $x] [incr x] [incr x] } {2147483646 {} 2147483647 2147483648} +test lindex-3.8 {compiled with static indices out of range, negative} { + list [lindex {a b c} -1] [lindex {a b c} -2] [lindex {a b c} -3] +} [lrepeat 3 {}] +test lindex-3.9 {compiled with calculated indices out of range, negative constant} { + list [lindex {a b c} -1-1] [lindex {a b c} -2+0] [lindex {a b c} -2+1] +} [lrepeat 3 {}] +test lindex-3.10 {compiled with calculated indices out of range, after end} { + list [lindex {a b c} end+1] [lindex {a b c} end+2] [lindex {a b c} end+3] +} [lrepeat 3 {}] # Indices relative to end |