diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-03-15 21:53:00 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-03-15 21:53:00 (GMT) |
| commit | db41a49d9cd891820e877f97e213d478d1ce6e1d (patch) | |
| tree | d336ccb6018daac740c9e216c5a735f7196907a8 /tests/lrange.test | |
| parent | 69868ee129e5fe87ad3e38afa7b92208974af881 (diff) | |
| parent | df06afadcfb949909d6a640b77fe234e266dc848 (diff) | |
| download | tcl-db41a49d9cd891820e877f97e213d478d1ce6e1d.zip tcl-db41a49d9cd891820e877f97e213d478d1ce6e1d.tar.gz tcl-db41a49d9cd891820e877f97e213d478d1ce6e1d.tar.bz2 | |
merge 8.7
Diffstat (limited to 'tests/lrange.test')
| -rw-r--r-- | tests/lrange.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lrange.test b/tests/lrange.test index 02b9c65..a5367a4 100644 --- a/tests/lrange.test +++ b/tests/lrange.test @@ -90,6 +90,24 @@ 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}] + # cleanup ::tcltest::cleanupTests |
