diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-16 17:52:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-16 17:52:38 +0200 |
commit | d792d4ec06cb21d4cb71fd28498a8cae2a4b5c95 (patch) | |
tree | d86b38f94fcd7bc9e0287aef6ca878bf045be101 /src | |
parent | 3d6e48a941acab51d8c045ec325783c0107a5d54 (diff) | |
parent | cb01925eb4cd117475c48b1724c8e6853ba59e83 (diff) | |
download | rneovim-d792d4ec06cb21d4cb71fd28498a8cae2a4b5c95.tar.gz rneovim-d792d4ec06cb21d4cb71fd28498a8cae2a4b5c95.tar.bz2 rneovim-d792d4ec06cb21d4cb71fd28498a8cae2a4b5c95.zip |
Merge pull request #10236 from janlazo/vim-8.1.1545
vim-patch:8.0.{1516,1549},8.1.{0044,1545}
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/globals.h | 3 | ||||
-rw-r--r-- | src/nvim/testdir/runtest.vim | 19 | ||||
-rw-r--r-- | src/nvim/testdir/shared.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_assert.vim | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_vimscript.vim | 2 |
5 files changed, 30 insertions, 3 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 5624d38bad..4fce02613c 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -938,6 +938,9 @@ EXTERN char_u e_interr[] INIT(= N_("Interrupted")); EXTERN char_u e_invaddr[] INIT(= N_("E14: Invalid address")); EXTERN char_u e_invarg[] INIT(= N_("E474: Invalid argument")); EXTERN char_u e_invarg2[] INIT(= N_("E475: Invalid argument: %s")); +EXTERN char_u e_invargval[] INIT(= N_("E475: Invalid value for argument %s")); +EXTERN char_u e_invargNval[] INIT(= N_( + "E475: Invalid value for argument %s: %s")); EXTERN char_u e_duparg2[] INIT(= N_("E983: Duplicate argument: %s")); EXTERN char_u e_invexpr2[] INIT(= N_("E15: Invalid expression: %s")); EXTERN char_u e_invrange[] INIT(= N_("E16: Invalid range")); diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 65329b58f8..6f039509f3 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -35,8 +35,11 @@ if &lines < 24 || &columns < 80 echoerr error split test.log $put =error - w - cquit + write + split messages + call append(line('$'), error) + write + qa! endif " Common with all tests on all systems. @@ -121,7 +124,10 @@ func RunTheTest(test) exe 'call ' . a:test else try + let s:test = a:test + au VimLeavePre * call EarlyExit(s:test) exe 'call ' . a:test + au! VimLeavePre catch /^\cskipped/ call add(s:messages, ' Skipped') call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) @@ -175,6 +181,15 @@ func AfterTheTest() endif endfunc +func EarlyExit(test) + " It's OK for the test we use to test the quit detection. + if a:test != 'Test_zz_quit_detected()' + call add(v:errors, 'Test caused Vim to exit: ' . a:test) + endif + + call FinishTesting() +endfunc + " This function can be called by a test if it wants to abort testing. func FinishTesting() call AfterTheTest() diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 5dea33e2ac..ac34dec569 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -134,6 +134,8 @@ func s:kill_server(cmd) endfunc " Wait for up to a second for "expr" to become true. +" A second argument can be used to specify a different timeout in msec. +" " Return time slept in milliseconds. With the +reltime feature this can be " more than the actual waiting time. Without +reltime it can also be less. func WaitFor(expr, ...) diff --git a/src/nvim/testdir/test_assert.vim b/src/nvim/testdir/test_assert.vim new file mode 100644 index 0000000000..fe87bd6ef5 --- /dev/null +++ b/src/nvim/testdir/test_assert.vim @@ -0,0 +1,7 @@ +" Test that the methods used for testing work. + +" Must be last. +func Test_zz_quit_detected() + " Verify that if a test function ends Vim the test script detects this. + quit +endfunc diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 05abf04d65..d0ecbef7e1 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1,4 +1,4 @@ -" Test various aspects of the Vim language. +" Test various aspects of the Vim script language. " Most of this was formerly in test49. "------------------------------------------------------------------------------- |