summaryrefslogtreecommitdiff
path: root/src/testdir/test55.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-24 19:47:27 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-24 19:47:27 +0000
commitf9393ef5efde2f425fbd9e19363186f8c9103376 (patch)
treeec493a8fec62c31f9fe21993c4907bf1c1f290cd /src/testdir/test55.in
parent4a85b4156098a30daf5b15a7fb7587a1c7c99f94 (diff)
downloadvim-git-f9393ef5efde2f425fbd9e19363186f8c9103376.tar.gz
updated for version 7.0fv7.0f
Diffstat (limited to 'src/testdir/test55.in')
-rw-r--r--src/testdir/test55.in57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/testdir/test55.in b/src/testdir/test55.in
index 5570c596e..d7cd4d91a 100644
--- a/src/testdir/test55.in
+++ b/src/testdir/test55.in
@@ -13,6 +13,12 @@ STARTTEST
:catch
: $put =v:exception[:14]
:endtry
+:" List slices
+:$put =string(l[:])
+:$put =string(l[1:])
+:$put =string(l[:-2])
+:$put =string(l[0:8])
+:$put =string(l[8:-1])
:"
:" List identity
:let ll = l
@@ -80,6 +86,57 @@ STARTTEST
:unlet d[-1]
:$put =string(d)
:"
+:" removing items out of range: silently skip items that don't exist
+let l = [0, 1, 2, 3]
+:unlet l[2:1]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[2:2]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[2:3]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[2:4]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[2:5]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[-1:2]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[-2:2]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[-3:2]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[-4:2]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[-5:2]
+:$put =string(l)
+let l = [0, 1, 2, 3]
+:unlet l[-6:2]
+:$put =string(l)
+:"
+:" assignment to a list
+:let l = [0, 1, 2, 3]
+:let [va, vb] = l[2:3]
+:$put =va
+:$put =vb
+:try
+: let [va, vb] = l
+:catch
+: $put =v:exception[:14]
+:endtry
+:try
+: let [va, vb] = l[1:1]
+:catch
+: $put =v:exception[:14]
+:endtry
+:"
:" manipulating a big Dictionary (hashtable.c has a border of 1000 entries)
:let d = {}
:for i in range(1500)