diff options
-rw-r--r-- | runtime/autoload/man.vim | 1 | ||||
-rwxr-xr-x | scripts/gen_vimdoc.py | 2 | ||||
-rw-r--r-- | src/nvim/eval/funcs.c | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_eval_stuff.vim | 111 | ||||
-rw-r--r-- | test/busted/outputHandlers/nvim.lua | 2 |
5 files changed, 72 insertions, 45 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 8bf95651b7..4f132b6121 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -58,6 +58,7 @@ function! man#open_page(count, mods, ...) abort else execute 'silent keepalt' a:mods 'stag' l:target endif + call s:set_options(v:false) finally call setbufvar(l:buf, '&tagfunc', l:save_tfu) endtry diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 320c44e860..c8eb71985c 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -1130,7 +1130,7 @@ Doxyfile = textwrap.dedent(''' INPUT_FILTER = "{filter}" EXCLUDE = EXCLUDE_SYMLINKS = NO - EXCLUDE_PATTERNS = */private/* */health.lua + EXCLUDE_PATTERNS = */private/* */health.lua */_*.lua EXCLUDE_SYMBOLS = EXTENSION_MAPPING = lua=C EXTRACT_PRIVATE = NO diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index fda33fdfdd..bcbd2266d3 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -4446,6 +4446,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) "user_commands", "vartabs", "vertsplit", + "vimscript-1", "virtualedit", "visual", "visualextra", diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 98e098387e..f7b6704610 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -12,6 +12,48 @@ func Test_catch_return_with_error() call assert_equal(1, s:foo()) endfunc +func Test_nocatch_restore_silent_emsg() + silent! try + throw 1 + catch + endtry + echoerr 'wrong' + let c1 = nr2char(screenchar(&lines, 1)) + let c2 = nr2char(screenchar(&lines, 2)) + let c3 = nr2char(screenchar(&lines, 3)) + let c4 = nr2char(screenchar(&lines, 4)) + let c5 = nr2char(screenchar(&lines, 5)) + call assert_equal('wrong', c1 . c2 . c3 . c4 . c5) +endfunc + +func Test_mkdir_p() + call mkdir('Xmkdir/nested', 'p') + call assert_true(isdirectory('Xmkdir/nested')) + try + " Trying to make existing directories doesn't error + call mkdir('Xmkdir', 'p') + call mkdir('Xmkdir/nested', 'p') + catch /E739:/ + call assert_report('mkdir(..., "p") failed for an existing directory') + endtry + " 'p' doesn't suppress real errors + call writefile([], 'Xfile') + call assert_fails('call mkdir("Xfile", "p")', 'E739') + call delete('Xfile') + call delete('Xmkdir', 'rf') +endfunc + +func Test_line_continuation() + let array = [5, + "\ ignore this + \ 6, + "\ more to ignore + "\ more moreto ignore + \ ] + "\ and some more + call assert_equal([5, 6], array) +endfunc + func Test_E963() " These commands used to cause an internal error prior to vim 8.1.0563 let v_e = v:errors @@ -53,32 +95,11 @@ func Test_readfile_binary() call delete('XReadfile') endfunc -func Test_mkdir_p() - call mkdir('Xmkdir/nested', 'p') - call assert_true(isdirectory('Xmkdir/nested')) - try - " Trying to make existing directories doesn't error - call mkdir('Xmkdir', 'p') - call mkdir('Xmkdir/nested', 'p') - catch /E739:/ - call assert_report('mkdir(..., "p") failed for an existing directory') - endtry - " 'p' doesn't suppress real errors - call writefile([], 'Xfile') - call assert_fails('call mkdir("Xfile", "p")', 'E739') - call delete('Xfile') - call delete('Xmkdir', 'rf') -endfunc - -func Test_line_continuation() - let array = [5, - "\ ignore this - \ 6, - "\ more to ignore - "\ more moreto ignore - \ ] - "\ and some more - call assert_equal([5, 6], array) +func Test_let_errmsg() + call assert_fails('let v:errmsg = []', 'E730:') + let v:errmsg = '' + call assert_fails('let v:errmsg = []', 'E730:') + let v:errmsg = '' endfunc func Test_string_concatenation() @@ -119,25 +140,29 @@ func Test_skip_after_throw() endtry endfunc -func Test_nocatch_restore_silent_emsg() - silent! try - throw 1 - catch - endtry - echoerr 'wrong' - let c1 = nr2char(screenchar(&lines, 1)) - let c2 = nr2char(screenchar(&lines, 2)) - let c3 = nr2char(screenchar(&lines, 3)) - let c4 = nr2char(screenchar(&lines, 4)) - let c5 = nr2char(screenchar(&lines, 5)) - call assert_equal('wrong', c1 . c2 . c3 . c4 . c5) +" scriptversion 1 +func Test_string_concat_scriptversion1() + call assert_true(has('vimscript-1')) + let a = 'a' + let b = 'b' + + echo a . b + let a .= b + let vers = 1.2.3 + call assert_equal('123', vers) + + if has('float') + call assert_fails('let f = .5', 'E15:') + endif endfunc -func Test_let_errmsg() - call assert_fails('let v:errmsg = []', 'E730:') - let v:errmsg = '' - call assert_fails('let v:errmsg = []', 'E730:') - let v:errmsg = '' +" scriptversion 1 +func Test_vvar_scriptversion1() + call assert_equal(15, 017) + call assert_equal(15, 0o17) + call assert_equal(15, 0O17) + call assert_equal(18, 018) + call assert_equal(511, 0o777) endfunc func Test_number_max_min_size() diff --git a/test/busted/outputHandlers/nvim.lua b/test/busted/outputHandlers/nvim.lua index 31d3415e35..0e9801b94b 100644 --- a/test/busted/outputHandlers/nvim.lua +++ b/test/busted/outputHandlers/nvim.lua @@ -2,7 +2,7 @@ local pretty = require 'pl.pretty' local global_helpers = require('test.helpers') -- Colors are disabled by default. #15610 -local colors = setmetatable({}, {__index = function() return function(s) return s end end}) +local colors = setmetatable({}, {__index = function() return function(s) return s == nil and '' or tostring(s) end end}) if os.getenv "TEST_COLORS" then colors = require 'term.colors' end |