diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-19 21:36:53 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-19 22:02:49 +0800 |
commit | 358f9b776b48e854fdb714c76b24c5929bbd8544 (patch) | |
tree | c8bd4ca539ac2606fa653ce3af06734f9cb13afa | |
parent | 2e790e9ad10bca3a64b20be75672a3c6a6f3d97c (diff) | |
download | rneovim-358f9b776b48e854fdb714c76b24c5929bbd8544.tar.gz rneovim-358f9b776b48e854fdb714c76b24c5929bbd8544.tar.bz2 rneovim-358f9b776b48e854fdb714c76b24c5929bbd8544.zip |
vim-patch:8.2.2632: not all command line arguments are tested
Problem: Not all command line arguments are tested.
Solution: Add tests for -D and -serverlist. (Dominique Pellé, closes vim/vim#7992)
https://github.com/vim/vim/commit/c5cf369e9543ff065e2e1da91da3218c223840e2
Cherry-pick two deletions from patch 8.2.1799.
-rw-r--r-- | src/nvim/testdir/test_clientserver.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_startup.vim | 17 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_clientserver.vim b/src/nvim/testdir/test_clientserver.vim index 788b1dd204..edf36b413b 100644 --- a/src/nvim/testdir/test_clientserver.vim +++ b/src/nvim/testdir/test_clientserver.vim @@ -38,6 +38,14 @@ func Test_client_server() " When using valgrind it takes much longer. call WaitForAssert({-> assert_match(name, serverlist())}) + if !has('win32') + if RunVim([], [], '--serverlist >Xtest_serverlist') + let lines = readfile('Xtest_serverlist') + call assert_true(index(lines, 'XVIMTEST') >= 0) + endif + call delete('Xtest_serverlist') + endif + eval name->remote_foreground() call remote_send(name, ":let testvar = 'yes'\<CR>") diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim index 846838b25d..39fafbf7b4 100644 --- a/src/nvim/testdir/test_startup.vim +++ b/src/nvim/testdir/test_startup.vim @@ -1130,7 +1130,6 @@ func Test_n_arg() call assert_equal([], readfile('Xtestout')) call delete('Xtestout') endif - call delete('Xafter') endfunc " Test for the "-h" (help) argument @@ -1164,7 +1163,21 @@ func Test_E_arg() call assert_equal([], readfile('Xtestout')) call delete('Xtestout') endif - call delete('Xafter') +endfunc + +" Test for the "-D" (debugger) argument +func Test_D_arg() + CheckRunVimInTerminal + + let cmd = GetVimCommandCleanTerm() .. ' -D' + let buf = term_start(cmd, {'term_rows' : 10}) + call WaitForAssert({-> assert_equal("running", term_getstatus(buf))}) + + call WaitForAssert({-> assert_equal('Entering Debug mode. Type "cont" to continue.', + \ term_getline(buf, 7))}) + call WaitForAssert({-> assert_equal('>', term_getline(buf, 10))}) + + call StopVimInTerminal(buf) endfunc " Test for too many edit argument errors |