aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/autocmd/textchanged_spec.lua150
-rw-r--r--test/functional/core/fileio_spec.lua10
-rw-r--r--test/functional/editor/completion_spec.lua87
-rw-r--r--test/functional/options/defaults_spec.lua25
-rw-r--r--test/functional/terminal/tui_spec.lua1
-rw-r--r--test/functional/ui/decorations_spec.lua66
-rw-r--r--test/functional/ui/multigrid_spec.lua4
-rw-r--r--test/old/testdir/check.vim16
-rw-r--r--test/old/testdir/test.sh4
-rw-r--r--test/old/testdir/test_autocmd.vim60
-rw-r--r--test/old/testdir/test_cmdline.vim16
-rw-r--r--test/old/testdir/test_format.vim122
-rw-r--r--test/old/testdir/test_functions.vim22
-rw-r--r--test/old/testdir/test_messages.vim3
-rw-r--r--test/unit/helpers.lua2
-rw-r--r--test/unit/optionstr_spec.lua4
-rw-r--r--test/unit/os/fs_spec.lua4
-rw-r--r--test/unit/os/shell_spec.lua2
-rw-r--r--test/unit/path_spec.lua2
-rw-r--r--test/unit/undo_spec.lua5
20 files changed, 431 insertions, 174 deletions
diff --git a/test/functional/autocmd/textchanged_spec.lua b/test/functional/autocmd/textchanged_spec.lua
new file mode 100644
index 0000000000..ffeb76835d
--- /dev/null
+++ b/test/functional/autocmd/textchanged_spec.lua
@@ -0,0 +1,150 @@
+local helpers = require('test.functional.helpers')(after_each)
+local clear = helpers.clear
+local exec = helpers.exec
+local command = helpers.command
+local feed = helpers.feed
+local eq = helpers.eq
+local eval = helpers.eval
+local poke_eventloop = helpers.poke_eventloop
+
+before_each(clear)
+
+-- oldtest: Test_ChangedP()
+it('TextChangedI and TextChangedP autocommands', function()
+ -- The oldtest uses feedkeys() with 'x' flag, which never triggers TextChanged.
+ -- So don't add TextChanged autocommand here.
+ exec([[
+ call setline(1, ['foo', 'bar', 'foobar'])
+ set complete=. completeopt=menuone
+ au! TextChangedI <buffer> let g:autocmd ..= 'I'
+ au! TextChangedP <buffer> let g:autocmd ..= 'P'
+ call cursor(3, 1)
+ ]])
+
+ command([[let g:autocmd = '']])
+ feed('o')
+ poke_eventloop()
+ feed('<esc>')
+ eq('I', eval('g:autocmd'))
+
+ command([[let g:autocmd = '']])
+ feed('S')
+ poke_eventloop()
+ feed('f')
+ poke_eventloop()
+ eq('II', eval('g:autocmd'))
+ feed('<esc>')
+
+ command([[let g:autocmd = '']])
+ feed('S')
+ poke_eventloop()
+ feed('f')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ eq('IIP', eval('g:autocmd'))
+ feed('<esc>')
+
+ command([[let g:autocmd = '']])
+ feed('S')
+ poke_eventloop()
+ feed('f')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ eq('IIPP', eval('g:autocmd'))
+ feed('<esc>')
+
+ command([[let g:autocmd = '']])
+ feed('S')
+ poke_eventloop()
+ feed('f')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ eq('IIPPP', eval('g:autocmd'))
+ feed('<esc>')
+
+ command([[let g:autocmd = '']])
+ feed('S')
+ poke_eventloop()
+ feed('f')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ feed('<C-N>')
+ poke_eventloop()
+ feed('<C-N>')
+ eq('IIPPPP', eval('g:autocmd'))
+ feed('<esc>')
+
+ eq({'foo', 'bar', 'foobar', 'foo'}, eval('getline(1, "$")'))
+end)
+
+-- oldtest: Test_TextChangedI_with_setline()
+it('TextChangedI with setline()', function()
+ exec([[
+ let g:setline_handled = v:false
+ func SetLineOne()
+ if !g:setline_handled
+ call setline(1, "(x)")
+ let g:setline_handled = v:true
+ endif
+ endfunc
+ autocmd TextChangedI <buffer> call SetLineOne()
+ ]])
+
+ feed('i')
+ poke_eventloop()
+ feed('(')
+ poke_eventloop()
+ feed('<CR>')
+ poke_eventloop()
+ feed('<Esc>')
+ eq('(', eval('getline(1)'))
+ eq('x)', eval('getline(2)'))
+ command('undo')
+ eq('', eval('getline(1)'))
+ eq('', eval('getline(2)'))
+end)
+
+-- oldtest: Test_Changed_ChangedI()
+it('TextChanged is triggerd after TextChangedI', function()
+ exec([[
+ let [g:autocmd_i, g:autocmd_n] = ['','']
+
+ func! TextChangedAutocmdI(char)
+ let g:autocmd_{tolower(a:char)} = a:char .. b:changedtick
+ endfunc
+
+ augroup Test_TextChanged
+ au!
+ au TextChanged <buffer> :call TextChangedAutocmdI('N')
+ au TextChangedI <buffer> :call TextChangedAutocmdI('I')
+ augroup END
+ ]])
+
+ feed('i')
+ poke_eventloop()
+ feed('f')
+ poke_eventloop()
+ feed('o')
+ poke_eventloop()
+ feed('o')
+ poke_eventloop()
+ feed('<esc>')
+ eq('N5', eval('g:autocmd_n'))
+ eq('I5', eval('g:autocmd_i'))
+
+ command([[call feedkeys("yyp", 'tnix')]])
+ eq('N6', eval('g:autocmd_n'))
+ eq('I5', eval('g:autocmd_i'))
+end)
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua
index 8de78234ce..f2b360f0d8 100644
--- a/test/functional/core/fileio_spec.lua
+++ b/test/functional/core/fileio_spec.lua
@@ -377,4 +377,14 @@ describe('tmpdir', function()
rm_tmpdir()
eq('E5431: tempdir disappeared (3 times)', meths.get_vvar('errmsg'))
end)
+
+ it('$NVIM_APPNAME relative path', function()
+ clear({ env={
+ NVIM_APPNAME='a/b',
+ NVIM_LOG_FILE=testlog,
+ TMPDIR=os_tmpdir,
+ } })
+ matches([=[.*[/\\]a%%b%.[^/\\]+]=], funcs.tempname())
+ end)
+
end)
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua
index dcd7ef720f..8c299636cc 100644
--- a/test/functional/editor/completion_spec.lua
+++ b/test/functional/editor/completion_spec.lua
@@ -1032,93 +1032,6 @@ describe('completion', function()
]])
end)
- -- oldtest: Test_ChangedP()
- it('TextChangedI and TextChangedP autocommands', function()
- curbufmeths.set_lines(0, 1, false, { 'foo', 'bar', 'foobar'})
- source([[
- set complete=. completeopt=menuone
- let g:foo = []
- autocmd! TextChanged * :call add(g:foo, "N")
- autocmd! TextChangedI * :call add(g:foo, "I")
- autocmd! TextChangedP * :call add(g:foo, "P")
- call cursor(3, 1)
- ]])
-
- command('let g:foo = []')
- feed('o')
- poke_eventloop()
- feed('<esc>')
- eq({'I'}, eval('g:foo'))
-
- command('let g:foo = []')
- feed('S')
- poke_eventloop()
- feed('f')
- poke_eventloop()
- eq({'I', 'I'}, eval('g:foo'))
- feed('<esc>')
-
- command('let g:foo = []')
- feed('S')
- poke_eventloop()
- feed('f')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- eq({'I', 'I', 'P'}, eval('g:foo'))
- feed('<esc>')
-
- command('let g:foo = []')
- feed('S')
- poke_eventloop()
- feed('f')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- eq({'I', 'I', 'P', 'P'}, eval('g:foo'))
- feed('<esc>')
-
- command('let g:foo = []')
- feed('S')
- poke_eventloop()
- feed('f')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- eq({'I', 'I', 'P', 'P', 'P'}, eval('g:foo'))
- feed('<esc>')
-
- command('let g:foo = []')
- feed('S')
- poke_eventloop()
- feed('f')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- feed('<C-N>')
- poke_eventloop()
- feed('<C-N>')
- eq({'I', 'I', 'P', 'P', 'P', 'P'}, eval('g:foo'))
- feed('<esc>')
-
- eq({'foo', 'bar', 'foobar', 'foo'}, eval('getline(1, "$")'))
-
- source([[
- au! TextChanged
- au! TextChangedI
- au! TextChangedP
- set complete&vim completeopt&vim
- ]])
- end)
-
it('CompleteChanged autocommand', function()
curbufmeths.set_lines(0, 1, false, { 'foo', 'bar', 'foobar', ''})
source([[
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index 9b531bcafc..7858b626de 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -598,8 +598,7 @@ describe('stdpath()', function()
end)
it('reacts to $NVIM_APPNAME', function()
- local appname = "NVIM_APPNAME_TEST____________________________________" ..
- "______________________________________________________________________"
+ local appname = 'NVIM_APPNAME_TEST' .. ('_'):rep(106)
clear({env={ NVIM_APPNAME=appname }})
eq(appname, funcs.fnamemodify(funcs.stdpath('config'), ':t'))
eq(appname, funcs.fnamemodify(funcs.stdpath('cache'), ':t'))
@@ -616,10 +615,24 @@ describe('stdpath()', function()
-- Check that Nvim rejects invalid APPNAMEs
-- Call jobstart() and jobwait() in the same RPC request to reduce flakiness.
- eq(1, exec_lua([[
- local child = vim.fn.jobstart({ vim.v.progpath }, { env = { NVIM_APPNAME = 'a/b\\c' } })
- return vim.fn.jobwait({ child }, 3000)[1]
- ]]))
+ local function test_appname(testAppname, expected_exitcode)
+ local lua_code = string.format([[
+ local child = vim.fn.jobstart({ vim.v.progpath, '--clean', '--headless', '+qall!' }, { env = { NVIM_APPNAME = %q } })
+ return vim.fn.jobwait({ child }, %d)[1]
+ ]], alter_slashes(testAppname), 3000)
+ eq(expected_exitcode, exec_lua(lua_code))
+ end
+ -- Invalid appnames:
+ test_appname('a/../b', 1)
+ test_appname('../a', 1)
+ test_appname('a/..', 1)
+ test_appname('..', 1)
+ test_appname('.', 1)
+ test_appname('/', 1)
+ test_appname(is_os('win') and 'C:/a/b' or '/a/b', 1)
+ -- Valid appnames:
+ test_appname('a/b', 0)
+ test_appname('a/b\\c', 0)
end)
describe('returns a String', function()
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 53ee4c51f4..955a871d10 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -73,6 +73,7 @@ describe('TUI', function()
end
it('rapid resize #7572 #7628', function()
+ helpers.skip(helpers.is_asan(), 'Test extra unstable with ASAN. See #23762')
-- Need buffer rows to provoke the behavior.
feed_data(":edit test/functional/fixtures/bigfile.txt\n")
screen:expect([[
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index f535bdd1a6..2c4bcadc4b 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -521,6 +521,72 @@ describe('decorations providers', function()
]]}
end)
+ it('virtual text works with wrapped lines', function()
+ insert(mulholland)
+ feed('ggJj3JjJ')
+ setup_provider [[
+ local hl = api.nvim_get_hl_id_by_name "ErrorMsg"
+ local test_ns = api.nvim_create_namespace "mulholland"
+ function on_do(event, ...)
+ if event == "line" then
+ local win, buf, line = ...
+ api.nvim_buf_set_extmark(buf, test_ns, line, 0, {
+ virt_text = {{string.rep('/', line+1), 'ErrorMsg'}};
+ virt_text_pos='eol';
+ ephemeral = true;
+ })
+ api.nvim_buf_set_extmark(buf, test_ns, line, 6, {
+ virt_text = {{string.rep('*', line+1), 'ErrorMsg'}};
+ virt_text_pos='overlay';
+ ephemeral = true;
+ })
+ api.nvim_buf_set_extmark(buf, test_ns, line, 39, {
+ virt_text = {{string.rep('!', line+1), 'ErrorMsg'}};
+ virt_text_win_col=20;
+ ephemeral = true;
+ })
+ api.nvim_buf_set_extmark(buf, test_ns, line, 40, {
+ virt_text = {{string.rep('?', line+1), 'ErrorMsg'}};
+ virt_text_win_col=10;
+ ephemeral = true;
+ })
+ api.nvim_buf_set_extmark(buf, test_ns, line, 40, {
+ virt_text = {{string.rep(';', line+1), 'ErrorMsg'}};
+ virt_text_pos='overlay';
+ ephemeral = true;
+ })
+ api.nvim_buf_set_extmark(buf, test_ns, line, 40, {
+ virt_text = {{'+'}, {string.rep(' ', line+1), 'ErrorMsg'}};
+ virt_text_pos='right_align';
+ ephemeral = true;
+ })
+ end
+ end
+ ]]
+
+ screen:expect{grid=[[
+ // jus{2:*} to see if th{2:!}re was an accident |
+ {2:;}n Mulholl{2:?}nd Drive {2:/} +{2: }|
+ try_st{2:**}t(); bufref_{2:!!}save_buf; switch_b|
+ {2:;;}fer(&sav{2:??}buf, buf); {2://} +{2: }|
+ posp ={2:***}tmark(mark,{2:!!!}lse);^ restore_buf|
+ {2:;;;}(&save_{2:???}); {2:///} +{2: }|
+ {1:~ }|
+ |
+ ]]}
+ command('setlocal breakindent breakindentopt=shift:2')
+ screen:expect{grid=[[
+ // jus{2:*} to see if th{2:!}re was an accident |
+ {2:;}n Mulho{2:?}land Drive {2:/} +{2: }|
+ try_st{2:**}t(); bufref_{2:!!}save_buf; switch_b|
+ {2:;;}fer(&s{2:??}e_buf, buf); {2://} +{2: }|
+ posp ={2:***}tmark(mark,{2:!!!}lse);^ restore_buf|
+ {2:;;;}(&sav{2:???}uf); {2:///} +{2: }|
+ {1:~ }|
+ |
+ ]]}
+ end)
+
it('can highlight beyond EOL', function()
insert(mulholland)
setup_provider [[
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index 6f4082beda..5b982df2b5 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -2887,7 +2887,7 @@ describe('ext_multigrid', function()
## grid 3
|
## grid 4
- ^Lorem i|
+ Lorem i|
psum do|
lor sit|
amet, |
@@ -2896,7 +2896,7 @@ describe('ext_multigrid', function()
ipiscin|
g elit,|
sed do|
- eiusmo|
+ ^eiusmo|
{1:~ }|
## grid 5
some text |
diff --git a/test/old/testdir/check.vim b/test/old/testdir/check.vim
index af1a80250c..647e25b214 100644
--- a/test/old/testdir/check.vim
+++ b/test/old/testdir/check.vim
@@ -108,6 +108,22 @@ func CheckNotBSD()
endif
endfunc
+" Command to check for not running on a MacOS
+command CheckNotMac call CheckNotMac()
+func CheckNotMac()
+ if has('mac')
+ throw 'Skipped: does not work on MacOS'
+ endif
+endfunc
+
+" Command to check for not running on a MacOS M1 system.
+command CheckNotMacM1 call CheckNotMacM1()
+func CheckNotMacM1()
+ if has('mac') && system('uname -a') =~ '\<arm64\>'
+ throw 'Skipped: does not work on MacOS M1'
+ endif
+endfunc
+
" Command to check that making screendumps is supported.
" Caller must source screendump.vim
command CheckScreendump call CheckScreendump()
diff --git a/test/old/testdir/test.sh b/test/old/testdir/test.sh
index affdc308d1..6e7fa9db18 100644
--- a/test/old/testdir/test.sh
+++ b/test/old/testdir/test.sh
@@ -85,7 +85,5 @@ valgrind_check() {
}
check_sanitizer() {
- if test -n "${CLANG_SANITIZER}"; then
- check_logs "${1}" "*san.*" | cat
- fi
+ check_logs "${1}" "*san.*"
}
diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim
index b3238e8214..d80c505d80 100644
--- a/test/old/testdir/test_autocmd.vim
+++ b/test/old/testdir/test_autocmd.vim
@@ -104,6 +104,22 @@ if has('timers')
set updatetime&
endfunc
+ func Test_cursorhold_insert_ctrl_g_U()
+ au CursorHoldI * :
+ set updatetime=20
+ new
+ call timer_start(100, { -> feedkeys("\<Left>foo\<Esc>", 't') })
+ call feedkeys("i()\<C-g>U", 'tx!')
+ sleep 200m
+ call assert_equal('(foo)', getline(1))
+ undo
+ call assert_equal('', getline(1))
+
+ bwipe!
+ au! CursorHoldI
+ set updatetime&
+ endfunc
+
func Test_OptionSet_modeline()
CheckFunction test_override
call test_override('starting', 1)
@@ -2442,7 +2458,7 @@ endfunc
" Test TextChangedI and TextChangedP
func Test_ChangedP()
- throw 'Skipped: use test/functional/editor/completion_spec.lua'
+ throw 'Skipped: use test/functional/autocmd/textchanged_spec.lua'
new
call setline(1, ['foo', 'bar', 'foobar'])
call test_override("char_avail", 1)
@@ -2452,6 +2468,7 @@ func Test_ChangedP()
let g:autocmd .= a:char
endfunc
+ " TextChanged will not be triggered, only check that it isn't.
au! TextChanged <buffer> :call TextChangedAutocmd('N')
au! TextChangedI <buffer> :call TextChangedAutocmd('I')
au! TextChangedP <buffer> :call TextChangedAutocmd('P')
@@ -2505,7 +2522,7 @@ func SetLineOne()
endfunc
func Test_TextChangedI_with_setline()
- CheckFunction test_override
+ throw 'Skipped: use test/functional/autocmd/textchanged_spec.lua'
new
call test_override('char_avail', 1)
autocmd TextChangedI <buffer> call SetLineOne()
@@ -3433,6 +3450,45 @@ func Test_autocmd_vimgrep()
augroup END
endfunc
+" Test TextChangedI and TextChanged
+func Test_Changed_ChangedI()
+ throw 'Skipped: use test/functional/autocmd/textchanged_spec.lua'
+ new
+ call test_override("char_avail", 1)
+ let [g:autocmd_i, g:autocmd_n] = ['','']
+
+ func! TextChangedAutocmdI(char)
+ let g:autocmd_{tolower(a:char)} = a:char .. b:changedtick
+ endfunc
+
+ augroup Test_TextChanged
+ au!
+ au TextChanged <buffer> :call TextChangedAutocmdI('N')
+ au TextChangedI <buffer> :call TextChangedAutocmdI('I')
+ augroup END
+
+ call feedkeys("ifoo\<esc>", 'tnix')
+ " TODO: Test test does not seem to trigger TextChanged autocommand, this
+ " requires running Vim in a terminal window.
+ " call assert_equal('N3', g:autocmd_n)
+ call assert_equal('I3', g:autocmd_i)
+
+ call feedkeys("yyp", 'tnix')
+ " TODO: Test test does not seem to trigger TextChanged autocommand.
+ " call assert_equal('N4', g:autocmd_n)
+ call assert_equal('I3', g:autocmd_i)
+
+ " CleanUp
+ call test_override("char_avail", 0)
+ au! TextChanged <buffer>
+ au! TextChangedI <buffer>
+ augroup! Test_TextChanged
+ delfu TextChangedAutocmdI
+ unlet! g:autocmd_i g:autocmd_n
+
+ bw!
+endfunc
+
func Test_closing_autocmd_window()
let lines =<< trim END
edit Xa.txt
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index a85c8229af..54f5dd500b 100644
--- a/test/old/testdir/test_cmdline.vim
+++ b/test/old/testdir/test_cmdline.vim
@@ -3702,4 +3702,20 @@ func Test_custom_completion()
delfunc Check_customlist_completion
endfunc
+func Test_custom_completion_with_glob()
+ func TestGlobComplete(A, L, P)
+ return split(glob('Xglob*'), "\n")
+ endfunc
+
+ command -nargs=* -complete=customlist,TestGlobComplete TestGlobComplete :
+ call writefile([], 'Xglob1', 'D')
+ call writefile([], 'Xglob2', 'D')
+
+ call feedkeys(":TestGlobComplete \<Tab> \<Tab>\<C-N> \<Tab>\<C-P>;\<C-B>\"\<CR>", 'xt')
+ call assert_equal('"TestGlobComplete Xglob1 Xglob2 ;', @:)
+
+ delcommand TestGlobComplete
+ delfunc TestGlobComplete
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/test/old/testdir/test_format.vim b/test/old/testdir/test_format.vim
index eae8af7b92..d3578e7165 100644
--- a/test/old/testdir/test_format.vim
+++ b/test/old/testdir/test_format.vim
@@ -107,65 +107,65 @@ func Test_printf_pos_misc()
call CheckLegacyAndVim9Failure(["call printf('%1$d%2$d', 1, 3, 4)"], "E767:")
- call CheckLegacyAndVim9Failure(["call printf('%2$d%d', 1, 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%d%2$d', 1, 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%2$*1$d%d', 1, 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%d%2$*1$d', 1, 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%2$.*1$d%d', 1, 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%d%2$.*1$d', 1, 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%1$%')"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%1$')"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%1$_')"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*3$.*d', 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*.*2$d', 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*.*d', 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%*.*1$d', 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%*1$.*d', 3)"], "E1400:")
- call CheckLegacyAndVim9Failure(["call printf('%*1$.*1$d', 3)"], "E1400:")
-
- call CheckLegacyAndVim9Failure(["call printf('%2$d', 3, 3)"], "E1401:")
-
- call CheckLegacyAndVim9Failure(["call printf('%2$*1$d %1$ld', 3, 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$s %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$p %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$f %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$lud %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$llud %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$lld %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$s %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$c %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$ld %1$*1$d', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$ld %2$*1$d', 3, 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*1$ld', 3)"], "E1402:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*1$.*1$ld', 3)"], "E1402:")
-
- call CheckLegacyAndVim9Failure(["call printf('%1$d%2$d', 3)"], "E1403:")
-
- call CheckLegacyAndVim9Failure(["call printf('%1$d %1$s', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$ld %1$s', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$ud %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$s %1$f', 3.0)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*1$d %1$ld', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$s %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$p %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$f %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$lud %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$llud %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$lld %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$s %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$c %1$d', 3)"], "E1404:")
- call CheckLegacyAndVim9Failure(["call printf('%1$ld %1$d', 3)"], "E1404:")
-
- call CheckLegacyAndVim9Failure(["call printf('%1$.2$d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%01$d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%01$0d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*2d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*3.*2$d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*3$.2$d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$*3$.*2d', 3)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$1$.5d', 5)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$5.1$d', 5)"], "E1405:")
- call CheckLegacyAndVim9Failure(["call printf('%1$1$.1$d', 5)"], "E1405:")
+ call CheckLegacyAndVim9Failure(["call printf('%2$d%d', 1, 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%d%2$d', 1, 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%2$*1$d%d', 1, 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%d%2$*1$d', 1, 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%2$.*1$d%d', 1, 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%d%2$.*1$d', 1, 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$%')"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$')"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$_')"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*3$.*d', 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*.*2$d', 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*.*d', 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%*.*1$d', 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%*1$.*d', 3)"], "E1500:")
+ call CheckLegacyAndVim9Failure(["call printf('%*1$.*1$d', 3)"], "E1500:")
+
+ call CheckLegacyAndVim9Failure(["call printf('%2$d', 3, 3)"], "E1501:")
+
+ call CheckLegacyAndVim9Failure(["call printf('%2$*1$d %1$ld', 3, 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$s %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$p %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$f %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$lud %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$llud %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$lld %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$s %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$c %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$ld %1$*1$d', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$ld %2$*1$d', 3, 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*1$ld', 3)"], "E1502:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*1$.*1$ld', 3)"], "E1502:")
+
+ call CheckLegacyAndVim9Failure(["call printf('%1$d%2$d', 3)"], "E1503:")
+
+ call CheckLegacyAndVim9Failure(["call printf('%1$d %1$s', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$ld %1$s', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$ud %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$s %1$f', 3.0)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*1$d %1$ld', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$s %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$p %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$f %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$lud %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$llud %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$lld %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$s %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$c %1$d', 3)"], "E1504:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$ld %1$d', 3)"], "E1504:")
+
+ call CheckLegacyAndVim9Failure(["call printf('%1$.2$d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%01$d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%01$0d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*2d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*3.*2$d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*3$.2$d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$*3$.*2d', 3)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$1$.5d', 5)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$5.1$d', 5)"], "E1505:")
+ call CheckLegacyAndVim9Failure(["call printf('%1$1$.1$d', 5)"], "E1505:")
endfunc
func Test_printf_pos_float()
@@ -296,9 +296,9 @@ func Test_printf_pos_errors()
call CheckLegacyAndVim9Failure(['echo printf("%1$d", [])'], 'E745:')
call CheckLegacyAndVim9Failure(['echo printf("%1$d", 1, 2)'], 'E767:')
call CheckLegacyAndVim9Failure(['echo printf("%*d", 1)'], 'E766:')
- call CheckLegacyAndVim9Failure(['echo printf("%1$s")'], 'E1403:')
+ call CheckLegacyAndVim9Failure(['echo printf("%1$s")'], 'E1503:')
call CheckLegacyAndVim9Failure(['echo printf("%1$d", 1.2)'], 'E805:')
- call CheckLegacyAndVim9Failure(['echo printf("%1$f")'], 'E1403:')
+ call CheckLegacyAndVim9Failure(['echo printf("%1$f")'], 'E1503:')
endfunc
func Test_printf_pos_64bit()
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 3e1e5a4816..7b20f47f7a 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -3281,4 +3281,26 @@ func Test_fullcommand()
call assert_equal('', fullcommand(10))
endfunc
+" Test for glob() with shell special patterns
+func Test_glob_extended_bash()
+ CheckExecutable bash
+ CheckNotMSWindows
+ CheckNotMac " The default version of bash is old on macOS.
+
+ let _shell = &shell
+ set shell=bash
+
+ call mkdir('Xtestglob/foo/bar/src', 'p')
+ call writefile([], 'Xtestglob/foo/bar/src/foo.sh')
+ call writefile([], 'Xtestglob/foo/bar/src/foo.h')
+ call writefile([], 'Xtestglob/foo/bar/src/foo.cpp')
+
+ " Sort output of glob() otherwise we end up with different
+ " ordering depending on whether file system is case-sensitive.
+ let expected = ['Xtestglob/foo/bar/src/foo.cpp', 'Xtestglob/foo/bar/src/foo.h']
+ call assert_equal(expected, sort(glob('Xtestglob/**/foo.{h,cpp}', 0, 1)))
+ call delete('Xtestglob', 'rf')
+ let &shell=_shell
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/test/old/testdir/test_messages.vim b/test/old/testdir/test_messages.vim
index adafb6bd23..9a999d71a8 100644
--- a/test/old/testdir/test_messages.vim
+++ b/test/old/testdir/test_messages.vim
@@ -379,7 +379,8 @@ endfunc
" Test verbose message before echo command
func Test_echo_verbose_system()
CheckRunVimInTerminal
- CheckUnix
+ CheckUnix " needs the "seq" command
+ CheckNotMac " doesn't use /tmp
let buf = RunVimInTerminal('', {'rows': 10})
call term_sendkeys(buf, ":4 verbose echo system('seq 20')\<CR>")
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index 43b6980702..448209fe0b 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -137,6 +137,8 @@ local function filter_complex_blocks(body)
if not (string.find(line, "(^)", 1, true) ~= nil
or string.find(line, "_ISwupper", 1, true)
or string.find(line, "_Float")
+ or string.find(line, "__s128")
+ or string.find(line, "__u128")
or string.find(line, "msgpack_zone_push_finalizer")
or string.find(line, "msgpack_unpacker_reserve_buffer")
or string.find(line, "value_init_")
diff --git a/test/unit/optionstr_spec.lua b/test/unit/optionstr_spec.lua
index f8122f4fe0..2e7198a63a 100644
--- a/test/unit/optionstr_spec.lua
+++ b/test/unit/optionstr_spec.lua
@@ -4,10 +4,10 @@ local itp = helpers.gen_itp(it)
local to_cstr = helpers.to_cstr
local eq = helpers.eq
-local option = helpers.cimport("./src/nvim/optionstr.h")
+local optionstr = helpers.cimport("./src/nvim/optionstr.h")
local check_ff_value = function(ff)
- return option.check_ff_value(to_cstr(ff))
+ return optionstr.check_ff_value(to_cstr(ff))
end
describe('check_ff_value', function()
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua
index 3a40e97755..8f45d2b0c7 100644
--- a/test/unit/os/fs_spec.lua
+++ b/test/unit/os/fs_spec.lua
@@ -22,10 +22,6 @@ local endswith = helpers.endswith
local NODE_NORMAL = 0
local NODE_WRITABLE = 1
-cimport('./src/nvim/os/shell.h')
-cimport('./src/nvim/option_defs.h')
-cimport('./src/nvim/main.h')
-cimport('./src/nvim/fileio.h')
local fs = cimport('./src/nvim/os/os.h', './src/nvim/path.h')
cppimport('sys/stat.h')
cppimport('fcntl.h')
diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua
index 29a2b78491..3fb1afed44 100644
--- a/test/unit/os/shell_spec.lua
+++ b/test/unit/os/shell_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.unit.helpers')(after_each)
local itp = helpers.gen_itp(it)
local cimported = helpers.cimport(
'./src/nvim/os/shell.h',
- './src/nvim/option_defs.h',
+ './src/nvim/option_vars.h',
'./src/nvim/main.h',
'./src/nvim/memory.h'
)
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index f9ce1ff099..23f71cfe78 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -15,7 +15,7 @@ local mkdir = helpers.mkdir
cimport('string.h')
local cimp = cimport('./src/nvim/os/os.h', './src/nvim/path.h')
-local options = cimport('./src/nvim/option_defs.h')
+local options = cimport('./src/nvim/option_vars.h')
local length = 0
local buffer = nil
diff --git a/test/unit/undo_spec.lua b/test/unit/undo_spec.lua
index 9261eca19d..ee4203b94c 100644
--- a/test/unit/undo_spec.lua
+++ b/test/unit/undo_spec.lua
@@ -11,10 +11,7 @@ local neq = helpers.neq
local eq = helpers.eq
local mkdir = helpers.mkdir
-cimport('./src/nvim/ex_cmds_defs.h')
-cimport('./src/nvim/buffer_defs.h')
-local options = cimport('./src/nvim/option_defs.h')
--- TODO: remove: local vim = cimport('./src/nvim/vim.h')
+local options = cimport('./src/nvim/option_vars.h')
local undo = cimport('./src/nvim/undo.h')
local buffer = cimport('./src/nvim/buffer.h')