summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_arglist.vim
diff options
context:
space:
mode:
authorNir Lichtman <nir_lichtman@hotmail.com>2021-12-24 20:28:03 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-24 20:28:03 +0000
commit73a024209cbfbd5b39a2e974084d807c6131e2ed (patch)
tree3fc4d2207a59fd3b0bb04e92d1a282e64e61c4a2 /src/testdir/test_arglist.vim
parent806da5176e9e9ab011d927c4ca33a8dde1769539 (diff)
patch 8.2.3888: the argument list may contain duplicatesv8.2.3888
Problem: The argument list may contain duplicates. Solution: Add the :argdedeupe command. (Nir Lichtman, closes #6235)
Diffstat (limited to 'src/testdir/test_arglist.vim')
-rw-r--r--src/testdir/test_arglist.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim
index 9f9957ae1b..a7d707ca8e 100644
--- a/src/testdir/test_arglist.vim
+++ b/src/testdir/test_arglist.vim
@@ -416,6 +416,35 @@ func Test_argedit()
bw! x
endfunc
+" Test for the :argdedupe command
+func Test_argdedupe()
+ call Reset_arglist()
+ argdedupe
+ call assert_equal([], argv())
+ args a a a aa b b a b aa
+ argdedupe
+ call assert_equal(['a', 'aa', 'b'], argv())
+ args a b c
+ argdedupe
+ call assert_equal(['a', 'b', 'c'], argv())
+ args a
+ argdedupe
+ call assert_equal(['a'], argv())
+ args a A b B
+ argdedupe
+ if has('fname_case')
+ call assert_equal(['a', 'A', 'b', 'B'], argv())
+ else
+ call assert_equal(['a', 'b'], argv())
+ endif
+ args a b a c a b
+ last
+ argdedupe
+ next
+ call assert_equal('c', expand('%:t'))
+ %argd
+endfunc
+
" Test for the :argdelete command
func Test_argdelete()
call Reset_arglist()