diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-24 19:47:27 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-24 19:47:27 +0000 |
commit | f9393ef5efde2f425fbd9e19363186f8c9103376 (patch) | |
tree | ec493a8fec62c31f9fe21993c4907bf1c1f290cd /src/testdir | |
parent | 4a85b4156098a30daf5b15a7fb7587a1c7c99f94 (diff) | |
download | vim-git-f9393ef5efde2f425fbd9e19363186f8c9103376.tar.gz |
updated for version 7.0fv7.0f
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test55.in | 57 | ||||
-rw-r--r-- | src/testdir/test55.ok | 20 |
2 files changed, 77 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) diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok index caec674bd..1f52f2955 100644 --- a/src/testdir/test55.ok +++ b/src/testdir/test55.ok @@ -3,6 +3,11 @@ start: {'a': 1} 1 Vim(put):E684: +[1, 'as''d', [1, 2, function('strlen')], {'a': 1}] +['as''d', [1, 2, function('strlen')], {'a': 1}] +[1, 'as''d', [1, 2, function('strlen')]] +[1, 'as''d', [1, 2, function('strlen')], {'a': 1}] +[] 101101 {'1': 'asd', 'b': [1, 2, function('strlen')], '-1': {'a': 1}}asd ['-1', '1', 'b'] @@ -19,6 +24,21 @@ Vim(let):E706: l [1, 'as''d', {'a': 1}] [4] {'1': 99, '3': 33} +[0, 1, 2, 3] +[0, 1, 3] +[0, 1] +[0, 1] +[0, 1] +[0, 1, 2, 3] +[0, 1, 3] +[0, 3] +[3] +[3] +[3] +2 +3 +Vim(let):E687: +Vim(let):E688: 3000 2900 2001 1600 1501 Vim(let):E716: 1500 NONE 2999 |