diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-29 04:16:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-29 04:16:57 +0100 |
commit | 69bf634858a2a75f2984e42b1e4017bc529a040a (patch) | |
tree | 1584b32f67463ec2b31ac858e5ada499a34967af /src/testdir | |
parent | 8b530c1ff91f07cf6b0289a536992b7dfbc86598 (diff) | |
download | vim-git-69bf634858a2a75f2984e42b1e4017bc529a040a.tar.gz |
patch 8.1.2233: cannot get the Vim command line argumentsv8.1.2233
Problem: Cannot get the Vim command line arguments.
Solution: Add v:argv. (Dmitri Vereshchagin, closes #1322)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_startup.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim index f10eabb79..358ca8171 100644 --- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -671,3 +671,15 @@ func Test_start_with_tabs() " clean up call StopVimInTerminal(buf) endfunc + +func Test_v_argv() + " Can't catch the output of gvim. + CheckNotGui + + let out = system(GetVimCommand() . ' -es -V1 -X arg1 --cmd "echo v:argv" --cmd q') + let list = out->split("', '") + call assert_match('vim', list[0]) + let idx = index(list, 'arg1') + call assert_true(idx > 2) + call assert_equal(['arg1', '--cmd', 'echo v:argv', '--cmd', 'q'']'], list[idx:]) +endfunc |