diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2013-05-13 20:16:19 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2013-05-13 20:16:19 +0100 |
commit | 33901b74b16ce037c732d7a33444862d93c91065 (patch) | |
tree | 3bdbf1472b31187a665dd7b601f04ad869473b49 /tests | |
parent | a47cfa475700469d0ea0e7a7c80c5fef8690ac3f (diff) |
Array slicing. Closes #2.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/all.test b/tests/all.test index 5b38709b..4eaa9b61 100644 --- a/tests/all.test +++ b/tests/all.test @@ -167,6 +167,25 @@ null 3 # +# Slices +# + +[.[3:2], .[-5:4], .[:-2], .[-2:]] +[0,1,2,3,4,5,6] +[[], [2,3], [0,1,2,3,4], [5,6]] + +del(.[2:4],.[0],.[-2:]) +[0,1,2,3,4,5,6,7] +[1,4,5] + +.[2:4] = ([], ["a","b"], ["a","b","c"]) +[0,1,2,3,4,5,6,7] +[0,1,4,5,6,7] +[0,1,"a","b",4,5,6,7] +[0,1,"a","b","c",4,5,6,7] + + +# # Variables # |