diff options
| author | Marco Hinz <mh.codebro@gmail.com> | 2014-04-13 20:26:17 +0200 |
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-16 09:29:33 -0300 |
| commit | f54c050cf3389a6e646bd0e6cd80476c01cd752c (patch) | |
| tree | 1f9ffe605ddb0d41945b976e6cbcd1738b6d5caf /src/testdir | |
| parent | 98b0a6ffb460ffdc6b84b4273d8f9834803bfd31 (diff) | |
| download | rneovim-f54c050cf3389a6e646bd0e6cd80476c01cd752c.tar.gz rneovim-f54c050cf3389a6e646bd0e6cd80476c01cd752c.tar.bz2 rneovim-f54c050cf3389a6e646bd0e6cd80476c01cd752c.zip | |
vim-patch:7.4.218
Problem: It's not easy to remove duplicates from a list.
Solution: Add the uniq() function. (LCD)
https://code.google.com/p/vim/source/detail?r=ddc3f32a4b2191f829206322d46f0e9c7e365e22
Diffstat (limited to 'src/testdir')
| -rw-r--r-- | src/testdir/test55.in | 6 | ||||
| -rw-r--r-- | src/testdir/test55.ok | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/testdir/test55.in b/src/testdir/test55.in index 4b20de403f..85a8063774 100644 --- a/src/testdir/test55.in +++ b/src/testdir/test55.in @@ -323,13 +323,15 @@ let l = [0, 1, 2, 3] : $put ='caught ' . v:exception :endtry :" -:" reverse() and sort() -:let l = ['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', [0, 1, 2], 'x8'] +:" reverse(), sort(), uniq() +:let l = ['-0', 'A11', 2, 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5] +:$put =string(uniq(copy(l))) :$put =string(reverse(l)) :$put =string(reverse(reverse(l))) :$put =string(sort(l)) :$put =string(reverse(sort(l))) :$put =string(sort(reverse(sort(l)))) +:$put =string(uniq(sort(l))) :" :" splitting a string to a List :$put =string(split(' aa bb ')) diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok index 396c9bed19..be476e8e93 100644 --- a/src/testdir/test55.ok +++ b/src/testdir/test55.ok @@ -94,11 +94,13 @@ caught a:000[0] caught a:000[2] caught a:000[3] [1, 2, [3, 9, 5, 6], {'a': 12, '5': 8}] -['x8', [0, 1, 2], 'foo6', 'foo', 4, 'xaaa', 2, 'A11', '-0'] -['x8', [0, 1, 2], 'foo6', 'foo', 4, 'xaaa', 2, 'A11', '-0'] -['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 2, 4, [0, 1, 2]] -[[0, 1, 2], 4, 2, 'xaaa', 'x8', 'foo6', 'foo', 'A11', '-0'] -['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 2, 4, [0, 1, 2]] +['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5] +[1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'] +[1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'] +['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] +[[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'] +['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] +['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]] ['aa', 'bb'] ['aa', 'bb'] ['', 'aa', 'bb', ''] |