summaryrefslogtreecommitdiffstats
path: root/tests/lrange.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-03-15 15:34:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-03-15 15:34:00 (GMT)
commit7435702d63be37049674d56f6baef6012cb89378 (patch)
treecee1e121a10cd162f4f804cd703b33844e724d29 /tests/lrange.test
parent651697f7cd746dded1a031d4217376000a176037 (diff)
parentaa199edba612a516e6309290fb6dc4442a49a5ee (diff)
downloadtcl-7435702d63be37049674d56f6baef6012cb89378.zip
tcl-7435702d63be37049674d56f6baef6012cb89378.tar.gz
tcl-7435702d63be37049674d56f6baef6012cb89378.tar.bz2
merge 8.7
Diffstat (limited to 'tests/lrange.test')
-rw-r--r--tests/lrange.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lrange.test b/tests/lrange.test
index 0b1a7ca..3077d91 100644
--- a/tests/lrange.test
+++ b/tests/lrange.test
@@ -90,6 +90,22 @@ test lrange-3.1 {Bug 3588366: end-offsets before start} {
lrange $l 0 end-5
}} {1 2 3 4 5}
} {}
+test lrange-3.2 {compiled with static indices out of range, negative} {
+ list [lrange {a b c} -1 -2] [lrange {a b c} -2 -1] [lrange {a b c} -3 -2] [lrange {a b c} -2 -3]
+} [lrepeat 4 {}]
+test lrange-3.3 {compiled with calculated indices out of range, negative constant} {
+ list [lrange {a b c} 0-1 -1-1] [lrange {a b c} -2+0 0-1] [lrange {a b c} -2-1 -2+1] [lrange {a b c} -2+1 -2-1]
+} [lrepeat 4 {}]
+test lrange-3.4 {compiled with calculated indices out of range, after end} {
+ list [lrange {a b c} end+1 end+2] [lrange {a b c} end+2 end+1] [lrange {a b c} end+2 end+3] [lrange {a b c} end+3 end+2]
+} [lrepeat 4 {}]
+
+test lrange-3.5 {compiled with calculated indices, start out of range (negative)} {
+ list [lrange {a b c} -1 1] [lrange {a b c} -1+0 end-1] [lrange {a b c} -2 1] [lrange {a b c} -2+0 0+1]
+} [lrepeat 4 {a b}]
+test lrange-3.6 {compiled with calculated indices, end out of range (after end)} {
+ list [lrange {a b c} 1 end+1] [lrange {a b c} 1+0 2+1] [lrange {a b c} 1 end+1] [lrange {a b c} end-1 3+1]
+} [lrepeat 4 {b c}]
test lrange-4.1 {lrange pure promise} -body {
set ll1 [list $tcl_version 2 3 4]