Mercurial > vim
diff src/testdir/test_startup.vim @ 18477:e93cab5d0f0f v8.1.2233
patch 8.1.2233: cannot get the Vim command line arguments
Commit: https://github.com/vim/vim/commit/69bf634858a2a75f2984e42b1e4017bc529a040a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 29 04:16:57 2019 +0100
patch 8.1.2233: cannot get the Vim command line arguments
Problem: Cannot get the Vim command line arguments.
Solution: Add v:argv. (Dmitri Vereshchagin, closes https://github.com/vim/vim/issues/1322)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 29 Oct 2019 04:30:05 +0100 |
parents | 85160a3649b9 |
children | 068337e86133 |
line wrap: on
line diff
--- 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