diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2021-09-17 09:16:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-17 09:16:40 -0700 |
commit | d8de4eb685e35646c7d541e9a75bdc296127b7e2 (patch) | |
tree | 4bb05ec713856715ac9ba57e5d116eed344511b9 | |
parent | d56002f7b722facd97b0958e141c8ed2d01495f7 (diff) | |
download | rneovim-d8de4eb685e35646c7d541e9a75bdc296127b7e2.tar.gz rneovim-d8de4eb685e35646c7d541e9a75bdc296127b7e2.tar.bz2 rneovim-d8de4eb685e35646c7d541e9a75bdc296127b7e2.zip |
test: reorg #15698
Problem:
Subdirectories like "visual", "insert", "normal" encourage people to
separate *related* tests for no good reason. Typically the _mode_ is
not the relevant topic of a test (and when it is, _then_ create
an appropriate describe() or it()).
Solution:
- Delete the various `test/functional/<mode>/` subdirectories, move
their tests to more meaningful topics.
- Rename `…/normal/` to `…/editor/`.
- Move or merge `…/visual/*` and `…/insert/*` tests into here where
appropriate.
- Rename `…/eval/` to `…/vimscript/`.
- Move `…/viml/*` into here also.
* test(reorg): insert/* => editor/mode_insert_spec.lua
* test(reorg): cmdline/* => editor/mode_cmdline_spec.lua
* test(reorg): eval core tests => eval_spec.lua
-rw-r--r-- | test/functional/autocmd/focus_spec.lua (renamed from test/functional/autoread/focus_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/cmdline/ctrl_r_spec.lua | 34 | ||||
-rw-r--r-- | test/functional/editor/K_spec.lua (renamed from test/functional/normal/K_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/completion_spec.lua (renamed from test/functional/viml/completion_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/count_spec.lua (renamed from test/functional/normal/count_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/fold_spec.lua (renamed from test/functional/normal/fold_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/jump_spec.lua (renamed from test/functional/normal/jump_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/lang_spec.lua (renamed from test/functional/normal/lang_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/langmap_spec.lua (renamed from test/functional/normal/langmap_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/macro_spec.lua (renamed from test/functional/normal/macro_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/meta_key_spec.lua (renamed from test/functional/insert/insert_spec.lua) | 38 | ||||
-rw-r--r-- | test/functional/editor/mode_cmdline_spec.lua (renamed from test/functional/cmdline/history_spec.lua) | 39 | ||||
-rw-r--r-- | test/functional/editor/mode_insert_spec.lua | 89 | ||||
-rw-r--r-- | test/functional/editor/mode_visual_spec.lua (renamed from test/functional/visual/ctrl_o_spec.lua) | 7 | ||||
-rw-r--r-- | test/functional/editor/put_spec.lua (renamed from test/functional/normal/put_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/search_spec.lua (renamed from test/functional/normal/search_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/tabpage_spec.lua (renamed from test/functional/normal/tabpage_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/editor/undo_spec.lua (renamed from test/functional/normal/undo_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/eval/backtick_expansion_spec.lua | 50 | ||||
-rw-r--r-- | test/functional/eval/function_spec.lua | 37 | ||||
-rw-r--r-- | test/functional/eval/interrupt_spec.lua | 61 | ||||
-rw-r--r-- | test/functional/insert/ctrl_o_spec.lua | 54 | ||||
-rw-r--r-- | test/functional/insert/ctrl_r_spec.lua | 19 | ||||
-rw-r--r-- | test/functional/normal/meta_key_spec.lua | 22 | ||||
-rw-r--r-- | test/functional/viml/function_spec.lua | 216 | ||||
-rw-r--r-- | test/functional/vimscript/api_functions_spec.lua (renamed from test/functional/eval/api_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/buf_functions_spec.lua (renamed from test/functional/eval/buf_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/changedtick_spec.lua (renamed from test/functional/eval/changedtick_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/container_functions_spec.lua (renamed from test/functional/eval/container_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/ctx_functions_spec.lua (renamed from test/functional/eval/ctx_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/environ_spec.lua (renamed from test/functional/eval/environ_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/errorlist_spec.lua (renamed from test/functional/viml/errorlist_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/eval_spec.lua | 146 | ||||
-rw-r--r-- | test/functional/vimscript/executable_spec.lua (renamed from test/functional/eval/executable_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/execute_spec.lua (renamed from test/functional/eval/execute_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/exepath_spec.lua (renamed from test/functional/eval/exepath_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/fnamemodify_spec.lua (renamed from test/functional/eval/fnamemodify_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/functions_spec.lua | 20 | ||||
-rw-r--r-- | test/functional/vimscript/getline_spec.lua (renamed from test/functional/eval/getline_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/glob_spec.lua (renamed from test/functional/eval/glob_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/has_spec.lua (renamed from test/functional/eval/has_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/hostname_spec.lua (renamed from test/functional/eval/hostname_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/input_spec.lua (renamed from test/functional/eval/input_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/json_functions_spec.lua (renamed from test/functional/eval/json_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/lang_spec.lua (renamed from test/functional/viml/lang_spec.lua) | 2 | ||||
-rw-r--r-- | test/functional/vimscript/let_spec.lua (renamed from test/functional/eval/let_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/map_functions_spec.lua (renamed from test/functional/eval/map_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/match_functions_spec.lua (renamed from test/functional/eval/match_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/minmax_functions_spec.lua (renamed from test/functional/eval/minmax_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/modeline_spec.lua (renamed from test/functional/eval/modeline_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/msgpack_functions_spec.lua (renamed from test/functional/eval/msgpack_functions_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/null_spec.lua (renamed from test/functional/eval/null_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/operators_spec.lua (renamed from test/functional/eval/operators_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/printf_spec.lua (renamed from test/functional/eval/printf_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/reltime_spec.lua (renamed from test/functional/eval/reltime_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/server_spec.lua (renamed from test/functional/eval/server_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/setpos_spec.lua (renamed from test/functional/eval/setpos_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/sort_spec.lua (renamed from test/functional/eval/sort_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/special_vars_spec.lua (renamed from test/functional/eval/special_vars_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/string_spec.lua (renamed from test/functional/eval/string_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/system_spec.lua (renamed from test/functional/eval/system_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/timer_spec.lua (renamed from test/functional/eval/timer_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/uniq_spec.lua (renamed from test/functional/eval/uniq_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/vvar_event_spec.lua (renamed from test/functional/eval/vvar_event_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/wait_spec.lua (renamed from test/functional/eval/wait_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/vimscript/writefile_spec.lua (renamed from test/functional/eval/writefile_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/visual/meta_key_spec.lua | 22 |
67 files changed, 320 insertions, 536 deletions
diff --git a/test/functional/autoread/focus_spec.lua b/test/functional/autocmd/focus_spec.lua index 3f9a0ad09b..3f9a0ad09b 100644 --- a/test/functional/autoread/focus_spec.lua +++ b/test/functional/autocmd/focus_spec.lua diff --git a/test/functional/cmdline/ctrl_r_spec.lua b/test/functional/cmdline/ctrl_r_spec.lua deleted file mode 100644 index a0f3955282..0000000000 --- a/test/functional/cmdline/ctrl_r_spec.lua +++ /dev/null @@ -1,34 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear, insert, funcs, eq, feed = - helpers.clear, helpers.insert, helpers.funcs, helpers.eq, helpers.feed - -describe('cmdline CTRL-R', function() - before_each(clear) - - it('pasting non-special register inserts <CR> *between* lines', function() - insert([[ - line1abc - line2somemoretext - ]]) - -- Yank 2 lines linewise, then paste to cmdline. - feed([[<C-\><C-N>gg0yj:<C-R>0]]) - -- <CR> inserted between lines, NOT after the final line. - eq('line1abc\rline2somemoretext', funcs.getcmdline()) - - -- Yank 2 lines charwise, then paste to cmdline. - feed([[<C-\><C-N>gg05lyvj:<C-R>0]]) - -- <CR> inserted between lines, NOT after the final line. - eq('abc\rline2', funcs.getcmdline()) - - -- Yank 1 line linewise, then paste to cmdline. - feed([[<C-\><C-N>ggyy:<C-R>0]]) - -- No <CR> inserted. - eq('line1abc', funcs.getcmdline()) - end) - - it('pasting special register inserts <CR>, <NL>', function() - feed([[:<C-R>="foo\nbar\rbaz"<CR>]]) - eq('foo\nbar\rbaz', funcs.getcmdline()) - end) -end) - diff --git a/test/functional/normal/K_spec.lua b/test/functional/editor/K_spec.lua index 40f36491e4..40f36491e4 100644 --- a/test/functional/normal/K_spec.lua +++ b/test/functional/editor/K_spec.lua diff --git a/test/functional/viml/completion_spec.lua b/test/functional/editor/completion_spec.lua index befad29922..befad29922 100644 --- a/test/functional/viml/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua diff --git a/test/functional/normal/count_spec.lua b/test/functional/editor/count_spec.lua index 94f741250a..94f741250a 100644 --- a/test/functional/normal/count_spec.lua +++ b/test/functional/editor/count_spec.lua diff --git a/test/functional/normal/fold_spec.lua b/test/functional/editor/fold_spec.lua index 00e83bedc8..00e83bedc8 100644 --- a/test/functional/normal/fold_spec.lua +++ b/test/functional/editor/fold_spec.lua diff --git a/test/functional/normal/jump_spec.lua b/test/functional/editor/jump_spec.lua index 9e7158e2f7..9e7158e2f7 100644 --- a/test/functional/normal/jump_spec.lua +++ b/test/functional/editor/jump_spec.lua diff --git a/test/functional/normal/lang_spec.lua b/test/functional/editor/lang_spec.lua index 24d1262f5f..24d1262f5f 100644 --- a/test/functional/normal/lang_spec.lua +++ b/test/functional/editor/lang_spec.lua diff --git a/test/functional/normal/langmap_spec.lua b/test/functional/editor/langmap_spec.lua index e4349a22e7..e4349a22e7 100644 --- a/test/functional/normal/langmap_spec.lua +++ b/test/functional/editor/langmap_spec.lua diff --git a/test/functional/normal/macro_spec.lua b/test/functional/editor/macro_spec.lua index 102d8fc723..102d8fc723 100644 --- a/test/functional/normal/macro_spec.lua +++ b/test/functional/editor/macro_spec.lua diff --git a/test/functional/insert/insert_spec.lua b/test/functional/editor/meta_key_spec.lua index 330cfbd830..2a9541ba96 100644 --- a/test/functional/insert/insert_spec.lua +++ b/test/functional/editor/meta_key_spec.lua @@ -1,32 +1,40 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local command = helpers.command -local eq = helpers.eq local expect = helpers.expect local funcs = helpers.funcs +local eq = helpers.eq -describe('insert-mode', function() +describe('meta-keys #8226 #13042', function() before_each(function() clear() end) - it('CTRL-@', function() - -- Inserts last-inserted text, leaves insert-mode. + it('ALT/META, normal-mode', function() + -- Unmapped ALT-chords behave as ESC+c insert('hello') - feed('i<C-@>x') - expect('hellhello') - - -- C-Space is the same as C-@. - -- CTRL-SPC inserts last-inserted text, leaves insert-mode. - feed('i<C-Space>x') - expect('hellhellhello') + feed('0<A-x><M-x>') + expect('llo') + -- Mapped ALT-chord behaves as mapped. + command('nnoremap <M-l> Ameta-l<Esc>') + command('nnoremap <A-j> Aalt-j<Esc>') + feed('<A-j><M-l>') + expect('lloalt-jmeta-l') + end) - -- CTRL-A inserts last inserted text - feed('i<C-A>x') - expect('hellhellhellhelloxo') + it('ALT/META, visual-mode', function() + -- Unmapped ALT-chords behave as ESC+c + insert('peaches') + feed('viw<A-x>viw<M-x>') + expect('peach') + -- Mapped ALT-chord behaves as mapped. + command('vnoremap <M-l> Ameta-l<Esc>') + command('vnoremap <A-j> Aalt-j<Esc>') + feed('viw<A-j>viw<M-l>') + expect('peachalt-jmeta-l') end) - it('ALT/META #8213', function() + it('ALT/META insert-mode', function() -- Mapped ALT-chord behaves as mapped. command('inoremap <M-l> meta-l') command('inoremap <A-j> alt-j') diff --git a/test/functional/cmdline/history_spec.lua b/test/functional/editor/mode_cmdline_spec.lua index ee2d36f642..0f7d821bb5 100644 --- a/test/functional/cmdline/history_spec.lua +++ b/test/functional/editor/mode_cmdline_spec.lua @@ -1,8 +1,41 @@ +-- Cmdline-mode tests. + local helpers = require('test.functional.helpers')(after_each) -local clear, meths, funcs, eq = - helpers.clear, helpers.meths, helpers.funcs, helpers.eq +local clear, insert, funcs, eq, feed = + helpers.clear, helpers.insert, helpers.funcs, helpers.eq, helpers.feed +local meths = helpers.meths + +describe('cmdline CTRL-R', function() + before_each(clear) + + it('pasting non-special register inserts <CR> *between* lines', function() + insert([[ + line1abc + line2somemoretext + ]]) + -- Yank 2 lines linewise, then paste to cmdline. + feed([[<C-\><C-N>gg0yj:<C-R>0]]) + -- <CR> inserted between lines, NOT after the final line. + eq('line1abc\rline2somemoretext', funcs.getcmdline()) + + -- Yank 2 lines charwise, then paste to cmdline. + feed([[<C-\><C-N>gg05lyvj:<C-R>0]]) + -- <CR> inserted between lines, NOT after the final line. + eq('abc\rline2', funcs.getcmdline()) + + -- Yank 1 line linewise, then paste to cmdline. + feed([[<C-\><C-N>ggyy:<C-R>0]]) + -- No <CR> inserted. + eq('line1abc', funcs.getcmdline()) + end) + + it('pasting special register inserts <CR>, <NL>', function() + feed([[:<C-R>="foo\nbar\rbaz"<CR>]]) + eq('foo\nbar\rbaz', funcs.getcmdline()) + end) +end) -describe('history support code', function() +describe('cmdline history', function() before_each(clear) it('correctly clears start of the history', function() diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua new file mode 100644 index 0000000000..46ab483036 --- /dev/null +++ b/test/functional/editor/mode_insert_spec.lua @@ -0,0 +1,89 @@ +-- Insert-mode tests. + +local helpers = require('test.functional.helpers')(after_each) +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local expect = helpers.expect +local command = helpers.command +local eq = helpers.eq +local eval = helpers.eval +local meths = helpers.meths + +describe('insert-mode', function() + before_each(function() + clear() + end) + + it('CTRL-@', function() + -- Inserts last-inserted text, leaves insert-mode. + insert('hello') + feed('i<C-@>x') + expect('hellhello') + + -- C-Space is the same as C-@. + -- CTRL-SPC inserts last-inserted text, leaves insert-mode. + feed('i<C-Space>x') + expect('hellhellhello') + + -- CTRL-A inserts last inserted text + feed('i<C-A>x') + expect('hellhellhellhelloxo') + end) + + describe('Ctrl-R', function() + it('works', function() + command("let @@ = 'test'") + feed('i<C-r>"') + expect('test') + end) + + it('works with multi-byte text', function() + command("let @@ = 'påskägg'") + feed('i<C-r>"') + expect('påskägg') + end) + end) + + describe('Ctrl-O', function() + it('enters command mode for one command', function() + feed('ihello world<C-o>') + feed(':let ctrlo = "test"<CR>') + feed('iii') + expect('hello worldiii') + eq(1, eval('ctrlo ==# "test"')) + end) + + it('re-enters insert mode at the end of the line when running startinsert', function() + -- #6962 + feed('ihello world<C-o>') + feed(':startinsert<CR>') + feed('iii') + expect('hello worldiii') + end) + + it('re-enters insert mode at the beginning of the line when running startinsert', function() + insert('hello world') + feed('0<C-o>') + feed(':startinsert<CR>') + feed('aaa') + expect('aaahello world') + end) + + it('re-enters insert mode in the middle of the line when running startinsert', function() + insert('hello world') + feed('bi<C-o>') + feed(':startinsert<CR>') + feed('ooo') + expect('hello oooworld') + end) + + it("doesn't cancel Ctrl-O mode when processing event", function() + feed('iHello World<c-o>') + eq({mode='niI', blocking=false}, meths.get_mode()) -- fast event + eq(2, eval('1+1')) -- causes K_EVENT key + eq({mode='niI', blocking=false}, meths.get_mode()) -- still in ctrl-o mode + feed('dd') + eq({mode='i', blocking=false}, meths.get_mode()) -- left ctrl-o mode + expect('') -- executed the command + end) + end) +end) diff --git a/test/functional/visual/ctrl_o_spec.lua b/test/functional/editor/mode_visual_spec.lua index 65a128053c..e9c117a1e5 100644 --- a/test/functional/visual/ctrl_o_spec.lua +++ b/test/functional/editor/mode_visual_spec.lua @@ -1,3 +1,5 @@ +-- Visual-mode tests. + local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local eq = helpers.eq @@ -6,10 +8,10 @@ local expect = helpers.expect local feed = helpers.feed local meths = helpers.meths -describe('select-mode Ctrl-O', function() +describe('visual-mode', function() before_each(clear) - it("doesn't cancel Ctrl-O mode when processing event", function() + it("select-mode Ctrl-O doesn't cancel Ctrl-O mode when processing event #15688", function() feed('iHello World<esc>gh<c-o>') eq({mode='vs', blocking=false}, meths.get_mode()) -- fast event eq(2, eval('1+1')) -- causes K_EVENT key @@ -21,3 +23,4 @@ describe('select-mode Ctrl-O', function() expect('h') -- selection is the whole line and is replaced end) end) + diff --git a/test/functional/normal/put_spec.lua b/test/functional/editor/put_spec.lua index 26967ecbba..26967ecbba 100644 --- a/test/functional/normal/put_spec.lua +++ b/test/functional/editor/put_spec.lua diff --git a/test/functional/normal/search_spec.lua b/test/functional/editor/search_spec.lua index d5df131725..d5df131725 100644 --- a/test/functional/normal/search_spec.lua +++ b/test/functional/editor/search_spec.lua diff --git a/test/functional/normal/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua index d1d6854b07..d1d6854b07 100644 --- a/test/functional/normal/tabpage_spec.lua +++ b/test/functional/editor/tabpage_spec.lua diff --git a/test/functional/normal/undo_spec.lua b/test/functional/editor/undo_spec.lua index a023ca3d90..a023ca3d90 100644 --- a/test/functional/normal/undo_spec.lua +++ b/test/functional/editor/undo_spec.lua diff --git a/test/functional/eval/backtick_expansion_spec.lua b/test/functional/eval/backtick_expansion_spec.lua deleted file mode 100644 index b1b44cfa8b..0000000000 --- a/test/functional/eval/backtick_expansion_spec.lua +++ /dev/null @@ -1,50 +0,0 @@ -local lfs = require('lfs') -local helpers = require('test.functional.helpers')(after_each) -local clear, command, eval, eq = helpers.clear, helpers.command, helpers.eval, helpers.eq -local write_file = helpers.write_file - -describe("backtick expansion", function() - setup(function() - clear() - lfs.mkdir("test-backticks") - write_file("test-backticks/file1", "test file 1") - write_file("test-backticks/file2", "test file 2") - write_file("test-backticks/file3", "test file 3") - lfs.mkdir("test-backticks/subdir") - write_file("test-backticks/subdir/file4", "test file 4") - -- Long path might cause "Press ENTER" prompt; use :silent to avoid it. - command('silent cd test-backticks') - end) - - teardown(function() - helpers.rmdir('test-backticks') - end) - - it("with default 'shell'", function() - if helpers.iswin() then - command(":silent args `dir /b *2`") - else - command(":silent args `echo ***2`") - end - eq({ "file2", }, eval("argv()")) - if helpers.iswin() then - command(":silent args `dir /s/b *4`") - eq({ "subdir\\file4", }, eval("map(argv(), 'fnamemodify(v:val, \":.\")')")) - else - command(":silent args `echo */*4`") - eq({ "subdir/file4", }, eval("argv()")) - end - end) - - it("with shell=fish", function() - if eval("executable('fish')") == 0 then - pending('missing "fish" command') - return - end - command("set shell=fish") - command(":silent args `echo ***2`") - eq({ "file2", }, eval("argv()")) - command(":silent args `echo */*4`") - eq({ "subdir/file4", }, eval("argv()")) - end) -end) diff --git a/test/functional/eval/function_spec.lua b/test/functional/eval/function_spec.lua deleted file mode 100644 index ce8850fcc2..0000000000 --- a/test/functional/eval/function_spec.lua +++ /dev/null @@ -1,37 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) - -local clear = helpers.clear -local eq = helpers.eq -local matches = helpers.matches -local exc_exec = helpers.exc_exec -local iswin = helpers.iswin -local eval = helpers.eval - -describe('Up to MAX_FUNC_ARGS arguments are handled by', function() - local max_func_args = 20 -- from eval.h - local range = helpers.funcs.range - - before_each(clear) - - it('printf()', function() - local printf = helpers.funcs.printf - local rep = helpers.funcs['repeat'] - local expected = '2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,' - eq(expected, printf(rep('%d,', max_func_args-1), unpack(range(2, max_func_args)))) - local ret = exc_exec('call printf("", 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') - eq('Vim(call):E740: Too many arguments for function printf', ret) - end) - - it('rpcnotify()', function() - local rpcnotify = helpers.funcs.rpcnotify - local ret = rpcnotify(0, 'foo', unpack(range(3, max_func_args))) - eq(1, ret) - ret = exc_exec('call rpcnotify(0, "foo", 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') - eq('Vim(call):E740: Too many arguments for function rpcnotify', ret) - end) -end) - -it('windowsversion()', function() - clear() - matches(iswin() and '^%d+%.%d+$' or '^$', eval('windowsversion()')) -end) diff --git a/test/functional/eval/interrupt_spec.lua b/test/functional/eval/interrupt_spec.lua deleted file mode 100644 index 05b1f4ff57..0000000000 --- a/test/functional/eval/interrupt_spec.lua +++ /dev/null @@ -1,61 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) - -local command = helpers.command -local meths = helpers.meths -local clear = helpers.clear -local sleep = helpers.sleep -local poke_eventloop = helpers.poke_eventloop -local feed = helpers.feed -local eq = helpers.eq - -local dur -local min_dur = 8 -local len = 131072 - -describe('List support code', function() - if not pending('does not actually allows interrupting with just got_int', function() end) then return end - -- The following tests are confirmed to work with os_breakcheck() just before - -- `if (got_int) {break;}` in tv_list_copy and list_join_inner() and not to - -- work without. - setup(function() - clear() - dur = 0 - while true do - command(([[ - let rt = reltime() - let bl = range(%u) - let dur = reltimestr(reltime(rt)) - ]]):format(len)) - dur = tonumber(meths.get_var('dur')) - if dur >= min_dur then - -- print(('Using len %u, dur %g'):format(len, dur)) - break - else - len = len * 2 - end - end - end) - it('allows interrupting copy', function() - feed(':let t_rt = reltime()<CR>:let t_bl = copy(bl)<CR>') - sleep(min_dur / 16 * 1000) - feed('<C-c>') - poke_eventloop() - command('let t_dur = reltimestr(reltime(t_rt))') - local t_dur = tonumber(meths.get_var('t_dur')) - if t_dur >= dur / 8 then - eq(nil, ('Took too long to cancel: %g >= %g'):format(t_dur, dur / 8)) - end - end) - it('allows interrupting join', function() - feed(':let t_rt = reltime()<CR>:let t_j = join(bl)<CR>') - sleep(min_dur / 16 * 1000) - feed('<C-c>') - poke_eventloop() - command('let t_dur = reltimestr(reltime(t_rt))') - local t_dur = tonumber(meths.get_var('t_dur')) - print(('t_dur: %g'):format(t_dur)) - if t_dur >= dur / 8 then - eq(nil, ('Took too long to cancel: %g >= %g'):format(t_dur, dur / 8)) - end - end) -end) diff --git a/test/functional/insert/ctrl_o_spec.lua b/test/functional/insert/ctrl_o_spec.lua deleted file mode 100644 index 011954fa9d..0000000000 --- a/test/functional/insert/ctrl_o_spec.lua +++ /dev/null @@ -1,54 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear = helpers.clear -local eq = helpers.eq -local eval = helpers.eval -local expect = helpers.expect -local feed = helpers.feed -local insert = helpers.insert -local meths = helpers.meths - -describe('insert-mode Ctrl-O', function() - before_each(clear) - - it('enters command mode for one command', function() - feed('ihello world<C-o>') - feed(':let ctrlo = "test"<CR>') - feed('iii') - expect('hello worldiii') - eq(1, eval('ctrlo ==# "test"')) - end) - - it('re-enters insert mode at the end of the line when running startinsert', function() - -- #6962 - feed('ihello world<C-o>') - feed(':startinsert<CR>') - feed('iii') - expect('hello worldiii') - end) - - it('re-enters insert mode at the beginning of the line when running startinsert', function() - insert('hello world') - feed('0<C-o>') - feed(':startinsert<CR>') - feed('aaa') - expect('aaahello world') - end) - - it('re-enters insert mode in the middle of the line when running startinsert', function() - insert('hello world') - feed('bi<C-o>') - feed(':startinsert<CR>') - feed('ooo') - expect('hello oooworld') - end) - - it("doesn't cancel Ctrl-O mode when processing event", function() - feed('iHello World<c-o>') - eq({mode='niI', blocking=false}, meths.get_mode()) -- fast event - eq(2, eval('1+1')) -- causes K_EVENT key - eq({mode='niI', blocking=false}, meths.get_mode()) -- still in ctrl-o mode - feed('dd') - eq({mode='i', blocking=false}, meths.get_mode()) -- left ctrl-o mode - expect('') -- executed the command - end) -end) diff --git a/test/functional/insert/ctrl_r_spec.lua b/test/functional/insert/ctrl_r_spec.lua deleted file mode 100644 index adc3c4b406..0000000000 --- a/test/functional/insert/ctrl_r_spec.lua +++ /dev/null @@ -1,19 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear, feed = helpers.clear, helpers.feed -local expect, command = helpers.expect, helpers.command - -describe('insert-mode Ctrl-R', function() - before_each(clear) - - it('works', function() - command("let @@ = 'test'") - feed('i<C-r>"') - expect('test') - end) - - it('works with multi-byte text', function() - command("let @@ = 'påskägg'") - feed('i<C-r>"') - expect('påskägg') - end) -end) diff --git a/test/functional/normal/meta_key_spec.lua b/test/functional/normal/meta_key_spec.lua deleted file mode 100644 index 9f9fad67d2..0000000000 --- a/test/functional/normal/meta_key_spec.lua +++ /dev/null @@ -1,22 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local command = helpers.command -local expect = helpers.expect - -describe('meta-keys-in-normal-mode', function() - before_each(function() - clear() - end) - - it('ALT/META', function() - -- Unmapped ALT-chords behave as Esc+c - insert('hello') - feed('0<A-x><M-x>') - expect('llo') - -- Mapped ALT-chord behaves as mapped. - command('nnoremap <M-l> Ameta-l<Esc>') - command('nnoremap <A-j> Aalt-j<Esc>') - feed('<A-j><M-l>') - expect('lloalt-jmeta-l') - end) -end) diff --git a/test/functional/viml/function_spec.lua b/test/functional/viml/function_spec.lua deleted file mode 100644 index b8137038b1..0000000000 --- a/test/functional/viml/function_spec.lua +++ /dev/null @@ -1,216 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) - -local eq = helpers.eq -local clear = helpers.clear -local dedent = helpers.dedent -local redir_exec = helpers.redir_exec - -before_each(clear) - -local function check_func(fname, body, indent) - if type(body) == 'number' then - body = ('return %i'):format(body) - end - eq(dedent(([[ - - function %s()%s - endfunction]] - ), 3):format( - fname, - body and ('\n1' .. (' '):rep(2 + (indent or 8)) .. body) or ''), - redir_exec('function ' .. fname)) -end - -describe(':endfunction', function() - it('accepts bang', function() - eq('', redir_exec([[ - function F() - endfunction! - ]])) - check_func('F') - eq('', redir_exec([[ - function! F() - return 1 - endfunction! - ]])) - check_func('F', 1) - end) - it('accepts comments', function() - eq('', redir_exec([[ - function F1() - endfunction " Comment - ]])) - check_func('F1') - eq('', redir_exec([[ - function F2() - endfunction " }}} - ]])) - check_func('F2') - eq('', redir_exec([[ - function F3() - endfunction " F3 - ]])) - check_func('F3') - eq('', redir_exec([[ - function F4() - endfunction! " F4 - ]])) - check_func('F4') - eq('', redir_exec([[ - function! F4() - return 2 - endfunction! " F4 - ]])) - check_func('F4', 2) - end) - it('accepts function name', function() - eq('', redir_exec([[ - function F0() - endfunction F0 - ]])) - check_func('F0') - eq('', redir_exec([[ - function F1() - endfunction! F1 - ]])) - check_func('F1') - eq('', redir_exec([[ - function! F2() - endfunction! F2 - ]])) - check_func('F2') - eq('', redir_exec([[ - function! F2() - return 3 - endfunction! F2 - ]])) - check_func('F2', 3) - end) - it('accepts weird characters', function() - eq('', redir_exec([[ - function F1() - endfunction: }}} - ]])) - check_func('F1') - -- From accurev - eq('', redir_exec([[ - function F2() - endfunction :}}} - ]])) - check_func('F2') - -- From cream-vimabbrev - eq('', redir_exec([[ - function F3() - endfunction 1}}} - ]])) - check_func('F3') - -- From pyunit - eq('', redir_exec([[ - function F4() - endfunction # }}} - ]])) - check_func('F4') - -- From vim-lldb - eq('', redir_exec([[ - function F5() - endfunction() - ]])) - check_func('F5') - -- From vim-mail - eq('', redir_exec([[ - function F6() - endfunction; - ]])) - check_func('F6') - end) - it('accepts commented bar', function() - eq('', redir_exec([[ - function F1() - endfunction " F1 | echo 42 - ]])) - check_func('F1') - eq('', redir_exec([[ - function! F1() - return 42 - endfunction! " F1 | echo 42 - ]])) - check_func('F1', 42) - end) - it('accepts uncommented bar', function() - eq('\n42', redir_exec([[ - function F1() - endfunction | echo 42 - ]])) - check_func('F1') - end) - it('allows running multiple commands', function() - eq('\n2', redir_exec([[ - function F1() - echo 2 - endfunction - call F1() - ]])) - check_func('F1', 'echo 2') - eq('\n2\n3\n4', redir_exec([[ - function F2() - echo 2 - endfunction F2 - function F3() - echo 3 - endfunction " F3 - function! F4() - echo 4 - endfunction! - call F2() - call F3() - call F4() - ]])) - check_func('F2', 'echo 2') - check_func('F3', 'echo 3') - check_func('F4', 'echo 4') - end) - it('allows running multiple commands with only one character in between', - function() - eq('\n3', redir_exec(dedent([[ - function! F1() - echo 3 - endfunction! - call F1()]]))) - check_func('F1', 'echo 3', 2) - eq('\n4', redir_exec(dedent([[ - function F5() - echo 4 - endfunction - call F5()]]))) - check_func('F5', 'echo 4', 2) - eq('\n5', redir_exec(dedent([[ - function F6() - echo 5 - endfunction " TEST - call F6()]]))) - check_func('F6', 'echo 5', 2) - eq('\n6', redir_exec(dedent([[ - function F7() - echo 6 - endfunction F7 - call F7()]]))) - check_func('F7', 'echo 6', 2) - eq('\n2\n3\n4', redir_exec(dedent([[ - function F2() - echo 2 - endfunction F2 - function F3() - echo 3 - endfunction " F3 - function! F4() - echo 4 - endfunction! - call F2() - call F3() - call F4()]]))) - check_func('F2', 'echo 2', 2) - check_func('F3', 'echo 3', 2) - check_func('F4', 'echo 4', 2) - end) -end) --- vim: foldmarker=▶,▲ diff --git a/test/functional/eval/api_functions_spec.lua b/test/functional/vimscript/api_functions_spec.lua index d07e74d40e..d07e74d40e 100644 --- a/test/functional/eval/api_functions_spec.lua +++ b/test/functional/vimscript/api_functions_spec.lua diff --git a/test/functional/eval/buf_functions_spec.lua b/test/functional/vimscript/buf_functions_spec.lua index e957e5f5af..e957e5f5af 100644 --- a/test/functional/eval/buf_functions_spec.lua +++ b/test/functional/vimscript/buf_functions_spec.lua diff --git a/test/functional/eval/changedtick_spec.lua b/test/functional/vimscript/changedtick_spec.lua index 99406d9d7a..99406d9d7a 100644 --- a/test/functional/eval/changedtick_spec.lua +++ b/test/functional/vimscript/changedtick_spec.lua diff --git a/test/functional/eval/container_functions_spec.lua b/test/functional/vimscript/container_functions_spec.lua index 04a3248c49..04a3248c49 100644 --- a/test/functional/eval/container_functions_spec.lua +++ b/test/functional/vimscript/container_functions_spec.lua diff --git a/test/functional/eval/ctx_functions_spec.lua b/test/functional/vimscript/ctx_functions_spec.lua index f23adbc556..f23adbc556 100644 --- a/test/functional/eval/ctx_functions_spec.lua +++ b/test/functional/vimscript/ctx_functions_spec.lua diff --git a/test/functional/eval/environ_spec.lua b/test/functional/vimscript/environ_spec.lua index 9e19568249..9e19568249 100644 --- a/test/functional/eval/environ_spec.lua +++ b/test/functional/vimscript/environ_spec.lua diff --git a/test/functional/viml/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua index 077d816903..077d816903 100644 --- a/test/functional/viml/errorlist_spec.lua +++ b/test/functional/vimscript/errorlist_spec.lua diff --git a/test/functional/vimscript/eval_spec.lua b/test/functional/vimscript/eval_spec.lua new file mode 100644 index 0000000000..e1459ab5b8 --- /dev/null +++ b/test/functional/vimscript/eval_spec.lua @@ -0,0 +1,146 @@ +-- Tests for core Vimscript "eval" behavior. +-- +-- See also: +-- let_spec.lua +-- null_spec.lua +-- operators_spec.lua +-- +-- Tests for the Vimscript |functions| library should live in: +-- test/functional/vimscript/<funcname>_spec.lua +-- test/functional/vimscript/functions_spec.lua + +local helpers = require('test.functional.helpers')(after_each) + +local lfs = require('lfs') +local clear = helpers.clear +local eq = helpers.eq +local exc_exec = helpers.exc_exec +local eval = helpers.eval +local command = helpers.command +local write_file = helpers.write_file +local meths = helpers.meths +local sleep = helpers.sleep +local poke_eventloop = helpers.poke_eventloop +local feed = helpers.feed + +describe('Up to MAX_FUNC_ARGS arguments are handled by', function() + local max_func_args = 20 -- from eval.h + local range = helpers.funcs.range + + before_each(clear) + + it('printf()', function() + local printf = helpers.funcs.printf + local rep = helpers.funcs['repeat'] + local expected = '2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,' + eq(expected, printf(rep('%d,', max_func_args-1), unpack(range(2, max_func_args)))) + local ret = exc_exec('call printf("", 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') + eq('Vim(call):E740: Too many arguments for function printf', ret) + end) + + it('rpcnotify()', function() + local rpcnotify = helpers.funcs.rpcnotify + local ret = rpcnotify(0, 'foo', unpack(range(3, max_func_args))) + eq(1, ret) + ret = exc_exec('call rpcnotify(0, "foo", 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') + eq('Vim(call):E740: Too many arguments for function rpcnotify', ret) + end) +end) + +describe("backtick expansion", function() + setup(function() + clear() + lfs.mkdir("test-backticks") + write_file("test-backticks/file1", "test file 1") + write_file("test-backticks/file2", "test file 2") + write_file("test-backticks/file3", "test file 3") + lfs.mkdir("test-backticks/subdir") + write_file("test-backticks/subdir/file4", "test file 4") + -- Long path might cause "Press ENTER" prompt; use :silent to avoid it. + command('silent cd test-backticks') + end) + + teardown(function() + helpers.rmdir('test-backticks') + end) + + it("with default 'shell'", function() + if helpers.iswin() then + command(":silent args `dir /b *2`") + else + command(":silent args `echo ***2`") + end + eq({ "file2", }, eval("argv()")) + if helpers.iswin() then + command(":silent args `dir /s/b *4`") + eq({ "subdir\\file4", }, eval("map(argv(), 'fnamemodify(v:val, \":.\")')")) + else + command(":silent args `echo */*4`") + eq({ "subdir/file4", }, eval("argv()")) + end + end) + + it("with shell=fish", function() + if eval("executable('fish')") == 0 then + pending('missing "fish" command') + return + end + command("set shell=fish") + command(":silent args `echo ***2`") + eq({ "file2", }, eval("argv()")) + command(":silent args `echo */*4`") + eq({ "subdir/file4", }, eval("argv()")) + end) +end) + +describe('List support code', function() + local dur + local min_dur = 8 + local len = 131072 + + if not pending('does not actually allows interrupting with just got_int', function() end) then return end + -- The following tests are confirmed to work with os_breakcheck() just before + -- `if (got_int) {break;}` in tv_list_copy and list_join_inner() and not to + -- work without. + setup(function() + clear() + dur = 0 + while true do + command(([[ + let rt = reltime() + let bl = range(%u) + let dur = reltimestr(reltime(rt)) + ]]):format(len)) + dur = tonumber(meths.get_var('dur')) + if dur >= min_dur then + -- print(('Using len %u, dur %g'):format(len, dur)) + break + else + len = len * 2 + end + end + end) + it('allows interrupting copy', function() + feed(':let t_rt = reltime()<CR>:let t_bl = copy(bl)<CR>') + sleep(min_dur / 16 * 1000) + feed('<C-c>') + poke_eventloop() + command('let t_dur = reltimestr(reltime(t_rt))') + local t_dur = tonumber(meths.get_var('t_dur')) + if t_dur >= dur / 8 then + eq(nil, ('Took too long to cancel: %g >= %g'):format(t_dur, dur / 8)) + end + end) + it('allows interrupting join', function() + feed(':let t_rt = reltime()<CR>:let t_j = join(bl)<CR>') + sleep(min_dur / 16 * 1000) + feed('<C-c>') + poke_eventloop() + command('let t_dur = reltimestr(reltime(t_rt))') + local t_dur = tonumber(meths.get_var('t_dur')) + print(('t_dur: %g'):format(t_dur)) + if t_dur >= dur / 8 then + eq(nil, ('Took too long to cancel: %g >= %g'):format(t_dur, dur / 8)) + end + end) +end) diff --git a/test/functional/eval/executable_spec.lua b/test/functional/vimscript/executable_spec.lua index 28aefb72e5..28aefb72e5 100644 --- a/test/functional/eval/executable_spec.lua +++ b/test/functional/vimscript/executable_spec.lua diff --git a/test/functional/eval/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index fccf52935b..fccf52935b 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua diff --git a/test/functional/eval/exepath_spec.lua b/test/functional/vimscript/exepath_spec.lua index 08d2c59af8..08d2c59af8 100644 --- a/test/functional/eval/exepath_spec.lua +++ b/test/functional/vimscript/exepath_spec.lua diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/vimscript/fnamemodify_spec.lua index d54a6db417..d54a6db417 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/vimscript/fnamemodify_spec.lua diff --git a/test/functional/vimscript/functions_spec.lua b/test/functional/vimscript/functions_spec.lua new file mode 100644 index 0000000000..0ad7fd8010 --- /dev/null +++ b/test/functional/vimscript/functions_spec.lua @@ -0,0 +1,20 @@ +-- Tests for misc Vimscript |functions|. +-- +-- If a function is non-trivial, consider moving its spec to: +-- test/functional/vimscript/<funcname>_spec.lua +-- +-- Core "eval" tests live in eval_spec.lua. + +local helpers = require('test.functional.helpers')(after_each) + +local clear = helpers.clear +local eval = helpers.eval +local iswin = helpers.iswin +local matches = helpers.matches + +before_each(clear) + +it('windowsversion()', function() + clear() + matches(iswin() and '^%d+%.%d+$' or '^$', eval('windowsversion()')) +end) diff --git a/test/functional/eval/getline_spec.lua b/test/functional/vimscript/getline_spec.lua index 3c56bde094..3c56bde094 100644 --- a/test/functional/eval/getline_spec.lua +++ b/test/functional/vimscript/getline_spec.lua diff --git a/test/functional/eval/glob_spec.lua b/test/functional/vimscript/glob_spec.lua index b8807ecfcc..b8807ecfcc 100644 --- a/test/functional/eval/glob_spec.lua +++ b/test/functional/vimscript/glob_spec.lua diff --git a/test/functional/eval/has_spec.lua b/test/functional/vimscript/has_spec.lua index a3af2d1a20..a3af2d1a20 100644 --- a/test/functional/eval/has_spec.lua +++ b/test/functional/vimscript/has_spec.lua diff --git a/test/functional/eval/hostname_spec.lua b/test/functional/vimscript/hostname_spec.lua index 6112cf64e3..6112cf64e3 100644 --- a/test/functional/eval/hostname_spec.lua +++ b/test/functional/vimscript/hostname_spec.lua diff --git a/test/functional/eval/input_spec.lua b/test/functional/vimscript/input_spec.lua index 14c02f9eb2..14c02f9eb2 100644 --- a/test/functional/eval/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua diff --git a/test/functional/eval/json_functions_spec.lua b/test/functional/vimscript/json_functions_spec.lua index 9b5e207c07..9b5e207c07 100644 --- a/test/functional/eval/json_functions_spec.lua +++ b/test/functional/vimscript/json_functions_spec.lua diff --git a/test/functional/viml/lang_spec.lua b/test/functional/vimscript/lang_spec.lua index 6d603b8822..d5254986ab 100644 --- a/test/functional/viml/lang_spec.lua +++ b/test/functional/vimscript/lang_spec.lua @@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq local exc_exec, source = helpers.exc_exec, helpers.source -describe('viml', function() +describe('vimscript', function() before_each(clear) it('parses `<SID>` with turkish locale', function() diff --git a/test/functional/eval/let_spec.lua b/test/functional/vimscript/let_spec.lua index 5bc703b567..5bc703b567 100644 --- a/test/functional/eval/let_spec.lua +++ b/test/functional/vimscript/let_spec.lua diff --git a/test/functional/eval/map_functions_spec.lua b/test/functional/vimscript/map_functions_spec.lua index 275c72d212..275c72d212 100644 --- a/test/functional/eval/map_functions_spec.lua +++ b/test/functional/vimscript/map_functions_spec.lua diff --git a/test/functional/eval/match_functions_spec.lua b/test/functional/vimscript/match_functions_spec.lua index 9f168c913a..9f168c913a 100644 --- a/test/functional/eval/match_functions_spec.lua +++ b/test/functional/vimscript/match_functions_spec.lua diff --git a/test/functional/eval/minmax_functions_spec.lua b/test/functional/vimscript/minmax_functions_spec.lua index c6eb754f91..c6eb754f91 100644 --- a/test/functional/eval/minmax_functions_spec.lua +++ b/test/functional/vimscript/minmax_functions_spec.lua diff --git a/test/functional/eval/modeline_spec.lua b/test/functional/vimscript/modeline_spec.lua index b2346079a1..b2346079a1 100644 --- a/test/functional/eval/modeline_spec.lua +++ b/test/functional/vimscript/modeline_spec.lua diff --git a/test/functional/eval/msgpack_functions_spec.lua b/test/functional/vimscript/msgpack_functions_spec.lua index 837b629858..837b629858 100644 --- a/test/functional/eval/msgpack_functions_spec.lua +++ b/test/functional/vimscript/msgpack_functions_spec.lua diff --git a/test/functional/eval/null_spec.lua b/test/functional/vimscript/null_spec.lua index bc88e6c8b3..bc88e6c8b3 100644 --- a/test/functional/eval/null_spec.lua +++ b/test/functional/vimscript/null_spec.lua diff --git a/test/functional/eval/operators_spec.lua b/test/functional/vimscript/operators_spec.lua index 4d07bc1b05..4d07bc1b05 100644 --- a/test/functional/eval/operators_spec.lua +++ b/test/functional/vimscript/operators_spec.lua diff --git a/test/functional/eval/printf_spec.lua b/test/functional/vimscript/printf_spec.lua index 27e24c4118..27e24c4118 100644 --- a/test/functional/eval/printf_spec.lua +++ b/test/functional/vimscript/printf_spec.lua diff --git a/test/functional/eval/reltime_spec.lua b/test/functional/vimscript/reltime_spec.lua index d87943e485..d87943e485 100644 --- a/test/functional/eval/reltime_spec.lua +++ b/test/functional/vimscript/reltime_spec.lua diff --git a/test/functional/eval/server_spec.lua b/test/functional/vimscript/server_spec.lua index 238d1aeb0f..238d1aeb0f 100644 --- a/test/functional/eval/server_spec.lua +++ b/test/functional/vimscript/server_spec.lua diff --git a/test/functional/eval/setpos_spec.lua b/test/functional/vimscript/setpos_spec.lua index 935f387bcc..935f387bcc 100644 --- a/test/functional/eval/setpos_spec.lua +++ b/test/functional/vimscript/setpos_spec.lua diff --git a/test/functional/eval/sort_spec.lua b/test/functional/vimscript/sort_spec.lua index e1cc2c2924..e1cc2c2924 100644 --- a/test/functional/eval/sort_spec.lua +++ b/test/functional/vimscript/sort_spec.lua diff --git a/test/functional/eval/special_vars_spec.lua b/test/functional/vimscript/special_vars_spec.lua index 97a12d490d..97a12d490d 100644 --- a/test/functional/eval/special_vars_spec.lua +++ b/test/functional/vimscript/special_vars_spec.lua diff --git a/test/functional/eval/string_spec.lua b/test/functional/vimscript/string_spec.lua index adc1af9b8e..adc1af9b8e 100644 --- a/test/functional/eval/string_spec.lua +++ b/test/functional/vimscript/string_spec.lua diff --git a/test/functional/eval/system_spec.lua b/test/functional/vimscript/system_spec.lua index 24a1f05390..24a1f05390 100644 --- a/test/functional/eval/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua diff --git a/test/functional/eval/timer_spec.lua b/test/functional/vimscript/timer_spec.lua index 9ee0735e40..9ee0735e40 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/vimscript/timer_spec.lua diff --git a/test/functional/eval/uniq_spec.lua b/test/functional/vimscript/uniq_spec.lua index 5cdba0a0f6..5cdba0a0f6 100644 --- a/test/functional/eval/uniq_spec.lua +++ b/test/functional/vimscript/uniq_spec.lua diff --git a/test/functional/eval/vvar_event_spec.lua b/test/functional/vimscript/vvar_event_spec.lua index eec8aa917a..eec8aa917a 100644 --- a/test/functional/eval/vvar_event_spec.lua +++ b/test/functional/vimscript/vvar_event_spec.lua diff --git a/test/functional/eval/wait_spec.lua b/test/functional/vimscript/wait_spec.lua index ee95e02a7f..ee95e02a7f 100644 --- a/test/functional/eval/wait_spec.lua +++ b/test/functional/vimscript/wait_spec.lua diff --git a/test/functional/eval/writefile_spec.lua b/test/functional/vimscript/writefile_spec.lua index 14be8c377c..14be8c377c 100644 --- a/test/functional/eval/writefile_spec.lua +++ b/test/functional/vimscript/writefile_spec.lua diff --git a/test/functional/visual/meta_key_spec.lua b/test/functional/visual/meta_key_spec.lua deleted file mode 100644 index 11f7203da0..0000000000 --- a/test/functional/visual/meta_key_spec.lua +++ /dev/null @@ -1,22 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local command = helpers.command -local expect = helpers.expect - -describe('meta-keys-in-visual-mode', function() - before_each(function() - clear() - end) - - it('ALT/META', function() - -- Unmapped ALT-chords behave as Esc+c - insert('peaches') - feed('viw<A-x>viw<M-x>') - expect('peach') - -- Mapped ALT-chord behaves as mapped. - command('vnoremap <M-l> Ameta-l<Esc>') - command('vnoremap <A-j> Aalt-j<Esc>') - feed('viw<A-j>viw<M-l>') - expect('peachalt-jmeta-l') - end) -end) |