aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test8.in
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test8.in')
-rw-r--r--tests/test8.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test8.in b/tests/test8.in
new file mode 100644
index 00000000..e03d9d05
--- /dev/null
+++ b/tests/test8.in
@@ -0,0 +1,21 @@
+# Test index ranges
+
+# Test variable expand
+set test (seq 10)
+echo $test[1..10] # normal range
+echo $test[10..1] # inverted range
+echo $test[2..5 8..6] # several ranges
+echo $test[-1..-2] # range with negative limits
+echo $test[-1..1] # range with mixed limits
+
+# Test variable set
+set test1 $test
+set test1[-1..1] $test # reverse variable
+echo $echo $test1
+set test1[2..4 -2..-4] $test1[4..2 -4..-2]
+echo $test1
+
+# Test command substitution
+echo (seq 5)[-1..1]
+echo (seq 10)[3..5 -2..2]
+