diff options
| author | Björn Linse <bjorn.linse@gmail.com> | 2020-10-19 23:14:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-19 23:14:55 +0200 |
| commit | 38efa1730f205bc2cd0da40b1fac8936eec1a835 (patch) | |
| tree | 7bdf7a2d1cb9752ce9c36aecbcbfb6469fe930bb /test/functional | |
| parent | eaee3d9297d114c81b05dd4ed104373eeb87bc11 (diff) | |
| parent | 07cc231142f5810c70818007dcd720271b1c0248 (diff) | |
| download | rneovim-38efa1730f205bc2cd0da40b1fac8936eec1a835.tar.gz rneovim-38efa1730f205bc2cd0da40b1fac8936eec1a835.tar.bz2 rneovim-38efa1730f205bc2cd0da40b1fac8936eec1a835.zip | |
Merge pull request #13118 from bfredl/mudholland
A Mudholland Dr. Recast
Diffstat (limited to 'test/functional')
40 files changed, 206 insertions, 206 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 246ee5c86c..0b52d06df9 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1252,7 +1252,7 @@ describe('API', function() {0:~ }| {1:very fail} | ]]) - helpers.wait() + helpers.poke_eventloop() -- shows up to &cmdheight lines nvim_async('err_write', 'more fail\ntoo fail\n') diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 8c7c3208c0..7471f50dbd 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -3,7 +3,7 @@ local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq, ok, feed, insert, eval = helpers.clear, helpers.nvim, helpers.curbuf, helpers.curbuf_contents, helpers.window, helpers.curwin, helpers.eq, helpers.neq, helpers.ok, helpers.feed, helpers.insert, helpers.eval -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop local curwinmeths = helpers.curwinmeths local funcs = helpers.funcs local request = helpers.request @@ -82,7 +82,7 @@ describe('API/win', function() insert("epilogue") local win = curwin() feed('gg') - wait() -- let nvim process the 'gg' command + poke_eventloop() -- let nvim process the 'gg' command -- cursor position is at beginning eq({1, 0}, window('get_cursor', win)) @@ -128,7 +128,7 @@ describe('API/win', function() insert("second line") feed('gg') - wait() -- let nvim process the 'gg' command + poke_eventloop() -- let nvim process the 'gg' command -- cursor position is at beginning local win = curwin() @@ -139,7 +139,7 @@ describe('API/win', function() -- move down a line feed('j') - wait() -- let nvim process the 'j' command + poke_eventloop() -- let nvim process the 'j' command -- cursor is still in column 5 eq({2, 5}, window('get_cursor', win)) diff --git a/test/functional/core/exit_spec.lua b/test/functional/core/exit_spec.lua index 80c65e4544..230b7f8e01 100644 --- a/test/functional/core/exit_spec.lua +++ b/test/functional/core/exit_spec.lua @@ -8,7 +8,7 @@ local run = helpers.run local funcs = helpers.funcs local nvim_prog = helpers.nvim_prog local redir_exec = helpers.redir_exec -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop describe('v:exiting', function() local cid @@ -52,7 +52,7 @@ describe(':cquit', function() local function test_cq(cmdline, exit_code, redir_msg) if redir_msg then eq('\n' .. redir_msg, redir_exec(cmdline)) - wait() + poke_eventloop() eq(2, eval("1+1")) -- Still alive? else funcs.system({nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless', '--cmd', cmdline}) diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 1155f12ffc..6d1182478a 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -11,7 +11,7 @@ local os_kill = helpers.os_kill local retry = helpers.retry local meths = helpers.meths local NIL = helpers.NIL -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop local iswin = helpers.iswin local get_pathsep = helpers.get_pathsep local pathroot = helpers.pathroot @@ -428,7 +428,7 @@ describe('jobs', function() \ } let job = jobstart(['cat', '-'], g:callbacks) ]]) - wait() + poke_eventloop() source([[ function! g:JobHandler(job_id, data, event) endfunction diff --git a/test/functional/eval/interrupt_spec.lua b/test/functional/eval/interrupt_spec.lua index 7f4ca95317..05b1f4ff57 100644 --- a/test/functional/eval/interrupt_spec.lua +++ b/test/functional/eval/interrupt_spec.lua @@ -4,7 +4,7 @@ local command = helpers.command local meths = helpers.meths local clear = helpers.clear local sleep = helpers.sleep -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop local feed = helpers.feed local eq = helpers.eq @@ -39,7 +39,7 @@ describe('List support code', function() feed(':let t_rt = reltime()<CR>:let t_bl = copy(bl)<CR>') sleep(min_dur / 16 * 1000) feed('<C-c>') - wait() + 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 @@ -50,7 +50,7 @@ describe('List support code', function() feed(':let t_rt = reltime()<CR>:let t_j = join(bl)<CR>') sleep(min_dur / 16 * 1000) feed('<C-c>') - wait() + 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)) diff --git a/test/functional/ex_cmds/oldfiles_spec.lua b/test/functional/ex_cmds/oldfiles_spec.lua index 802c3f68c6..003ab64dd4 100644 --- a/test/functional/ex_cmds/oldfiles_spec.lua +++ b/test/functional/ex_cmds/oldfiles_spec.lua @@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local buf, eq, feed_command = helpers.curbufmeths, helpers.eq, helpers.feed_command -local feed, wait = helpers.feed, helpers.wait +local feed, poke_eventloop = helpers.feed, helpers.poke_eventloop local ok = helpers.ok local eval = helpers.eval @@ -90,7 +90,7 @@ describe(':browse oldfiles', function() feed_command('edit testfile2') filename2 = buf.get_name() feed_command('wshada') - wait() + poke_eventloop() _clear() -- Ensure nvim is out of "Press ENTER..." prompt. diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 99cbf30c7c..0bd378d832 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -554,9 +554,9 @@ function module.curbuf(method, ...) return module.buffer(method, 0, ...) end -function module.wait() - -- Execute 'nvim_eval' (a deferred function) to block - -- until all pending input is processed. +function module.poke_eventloop() + -- Execute 'nvim_eval' (a deferred function) to + -- force at least one main_loop iteration session:request('nvim_eval', '1') end @@ -566,7 +566,7 @@ end --@see buf_lines() function module.curbuf_contents() - module.wait() -- Before inspecting the buffer, process all input. + module.poke_eventloop() -- Before inspecting the buffer, do whatever. return table.concat(module.curbuf('get_lines', 0, -1, true), '\n') end diff --git a/test/functional/legacy/005_bufleave_delete_buffer_spec.lua b/test/functional/legacy/005_bufleave_delete_buffer_spec.lua index 8b92c877a6..8e977aa73e 100644 --- a/test/functional/legacy/005_bufleave_delete_buffer_spec.lua +++ b/test/functional/legacy/005_bufleave_delete_buffer_spec.lua @@ -4,7 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local command, expect = helpers.command, helpers.expect -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop describe('test5', function() setup(clear) @@ -34,7 +34,7 @@ describe('test5', function() command('bwipe') feed('G?this is a<cr>') feed('othis is some more text<esc>') - wait() + poke_eventloop() -- Append some text to this file. @@ -45,7 +45,7 @@ describe('test5', function() command('bwipe!') -- Append an extra line to the output register. feed('ithis is another test line<esc>:yank A<cr>') - wait() + poke_eventloop() -- Output results command('%d') diff --git a/test/functional/legacy/006_argument_list_spec.lua b/test/functional/legacy/006_argument_list_spec.lua index 9f75a91fa8..d269bf8ec9 100644 --- a/test/functional/legacy/006_argument_list_spec.lua +++ b/test/functional/legacy/006_argument_list_spec.lua @@ -4,7 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local command, dedent, eq = helpers.command, helpers.dedent, helpers.eq local curbuf_contents = helpers.curbuf_contents -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop describe('argument list', function() setup(clear) @@ -17,7 +17,7 @@ describe('argument list', function() this is a test this is a test end of test file Xxx]]) - wait() + poke_eventloop() command('au BufReadPost Xxx2 next Xxx2 Xxx1') command('/^start of') @@ -30,7 +30,7 @@ describe('argument list', function() -- Write test file Xxx3 feed('$r3:.,/end of/w! Xxx3<cr>') - wait() + poke_eventloop() -- Redefine arglist; go to Xxx1 command('next! Xxx1 Xxx2 Xxx3') @@ -43,7 +43,7 @@ describe('argument list', function() -- Append contents of last window (Xxx1) feed('') - wait() + poke_eventloop() command('%yank A') -- should now be in Xxx2 diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua index cec4f93737..48dd24db9e 100644 --- a/test/functional/legacy/012_directory_spec.lua +++ b/test/functional/legacy/012_directory_spec.lua @@ -8,7 +8,7 @@ local lfs = require('lfs') local eq = helpers.eq local neq = helpers.neq -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop local funcs = helpers.funcs local meths = helpers.meths local clear = helpers.clear @@ -64,7 +64,7 @@ describe("'directory' option", function() eq(nil, lfs.attributes('.Xtest1.swp')) command('edit! Xtest1') - wait() + poke_eventloop() eq('Xtest1', funcs.buffer_name('%')) -- Verify that the swapfile exists. In the legacy test this was done by -- reading the output from :!ls. @@ -72,7 +72,7 @@ describe("'directory' option", function() meths.set_option('directory', './Xtest2,.') command('edit Xtest1') - wait() + poke_eventloop() -- swapfile should no longer exist in CWD. eq(nil, lfs.attributes('.Xtest1.swp')) @@ -82,7 +82,7 @@ describe("'directory' option", function() meths.set_option('directory', 'Xtest.je') command('edit Xtest2/Xtest3') eq(true, curbufmeths.get_option('swapfile')) - wait() + poke_eventloop() eq({ "Xtest3" }, ls_dir_sorted("Xtest2")) eq({ "Xtest3.swp" }, ls_dir_sorted("Xtest.je")) diff --git a/test/functional/legacy/023_edit_arguments_spec.lua b/test/functional/legacy/023_edit_arguments_spec.lua index e705397a2b..f59d192c1e 100644 --- a/test/functional/legacy/023_edit_arguments_spec.lua +++ b/test/functional/legacy/023_edit_arguments_spec.lua @@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, insert = helpers.clear, helpers.insert local command, expect = helpers.command, helpers.expect -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop describe(':edit', function() setup(clear) @@ -13,7 +13,7 @@ describe(':edit', function() The result should be in Xfile1: "fooPIPEbar", in Xfile2: "fooSLASHbar" foo|bar foo/bar]]) - wait() + poke_eventloop() -- Prepare some test files command('$-1w! Xfile1') diff --git a/test/functional/legacy/030_fileformats_spec.lua b/test/functional/legacy/030_fileformats_spec.lua index 2fd51602d8..15dbd05cf5 100644 --- a/test/functional/legacy/030_fileformats_spec.lua +++ b/test/functional/legacy/030_fileformats_spec.lua @@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local feed, clear, command = helpers.feed, helpers.clear, helpers.command local eq, write_file = helpers.eq, helpers.write_file -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop describe('fileformats option', function() setup(function() @@ -107,7 +107,7 @@ describe('fileformats option', function() command('bwipe XXDosMac') command('e! XXEol') feed('ggO<C-R>=&ffs<CR>:<C-R>=&ff<CR><ESC>') - wait() + poke_eventloop() command('w! XXtt54') command('bwipeout! XXEol') command('set fileformats=dos,mac') @@ -116,7 +116,7 @@ describe('fileformats option', function() command('bwipe XXUxDs') command('e! XXUxMac') feed('ggO<C-R>=&ffs<CR>:<C-R>=&ff<CR><ESC>') - wait() + poke_eventloop() command('w! XXtt62') command('bwipeout! XXUxMac') command('e! XXUxDsMc') @@ -124,7 +124,7 @@ describe('fileformats option', function() command('bwipe XXUxDsMc') command('e! XXMacEol') feed('ggO<C-R>=&ffs<CR>:<C-R>=&ff<CR><ESC>') - wait() + poke_eventloop() command('w! XXtt64') command('bwipeout! XXMacEol') @@ -135,7 +135,7 @@ describe('fileformats option', function() command('bwipe XXUxDsMc') command('e! XXEol') feed('ggO<C-R>=&ffs<CR>:<C-R>=&ff<CR><ESC>') - wait() + poke_eventloop() command('w! XXtt72') command('bwipeout! XXEol') command('set fileformats=mac,dos,unix') @@ -144,7 +144,7 @@ describe('fileformats option', function() command('bwipe XXUxDsMc') command('e! XXEol') feed('ggO<C-R>=&ffs<CR>:<C-R>=&ff<CR><ESC>') - wait() + poke_eventloop() command('w! XXtt82') command('bwipeout! XXEol') -- Try with 'binary' set. @@ -165,7 +165,7 @@ describe('fileformats option', function() -- char was. command('set fileformat=unix nobin') feed('ggdGaEND<esc>') - wait() + poke_eventloop() command('w >>XXtt01') command('w >>XXtt02') command('w >>XXtt11') @@ -204,52 +204,52 @@ describe('fileformats option', function() command('$r XXtt01') command('$r XXtt02') feed('Go1<esc>') - wait() + poke_eventloop() command('$r XXtt11') command('$r XXtt12') command('$r XXtt13') feed('Go2<esc>') - wait() + poke_eventloop() command('$r XXtt21') command('$r XXtt22') command('$r XXtt23') feed('Go3<esc>') - wait() + poke_eventloop() command('$r XXtt31') command('$r XXtt32') command('$r XXtt33') feed('Go4<esc>') - wait() + poke_eventloop() command('$r XXtt41') command('$r XXtt42') command('$r XXtt43') feed('Go5<esc>') - wait() + poke_eventloop() command('$r XXtt51') command('$r XXtt52') command('$r XXtt53') command('$r XXtt54') feed('Go6<esc>') - wait() + poke_eventloop() command('$r XXtt61') command('$r XXtt62') command('$r XXtt63') command('$r XXtt64') feed('Go7<esc>') - wait() + poke_eventloop() command('$r XXtt71') command('$r XXtt72') feed('Go8<esc>') - wait() + poke_eventloop() command('$r XXtt81') command('$r XXtt82') feed('Go9<esc>') - wait() + poke_eventloop() command('$r XXtt91') command('$r XXtt92') command('$r XXtt93') feed('Go10<esc>') - wait() + poke_eventloop() command('$r XXUnix') command('set nobinary ff&') diff --git a/test/functional/legacy/033_lisp_indent_spec.lua b/test/functional/legacy/033_lisp_indent_spec.lua index 5132333a5c..b27de6c16d 100644 --- a/test/functional/legacy/033_lisp_indent_spec.lua +++ b/test/functional/legacy/033_lisp_indent_spec.lua @@ -4,7 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local command, expect = helpers.command, helpers.expect -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop describe('lisp indent', function() setup(clear) @@ -39,7 +39,7 @@ describe('lisp indent', function() command('set lisp') command('/^(defun') feed('=G:/^(defun/,$yank A<cr>') - wait() + poke_eventloop() -- Put @a and clean empty line command('%d') diff --git a/test/functional/legacy/036_regexp_character_classes_spec.lua b/test/functional/legacy/036_regexp_character_classes_spec.lua index 38e8145d1c..6f66efcb67 100644 --- a/test/functional/legacy/036_regexp_character_classes_spec.lua +++ b/test/functional/legacy/036_regexp_character_classes_spec.lua @@ -15,7 +15,7 @@ end local function diff(text, nodedent) local fname = helpers.tmpname() command('w! '..fname) - helpers.wait() + helpers.poke_eventloop() local data = io.open(fname):read('*all') if nodedent then helpers.eq(text, data) diff --git a/test/functional/legacy/045_folding_spec.lua b/test/functional/legacy/045_folding_spec.lua index 1e5239ceac..7d7856fd37 100644 --- a/test/functional/legacy/045_folding_spec.lua +++ b/test/functional/legacy/045_folding_spec.lua @@ -59,7 +59,7 @@ describe('folding', function() feed('kYpj') feed_command('call append("$", foldlevel("."))') - helpers.wait() + helpers.poke_eventloop() screen:expect([[ dd {{{ | ee {{{ }}} | @@ -88,7 +88,7 @@ describe('folding', function() feed_command('call append("$", foldlevel(2))') feed('zR') - helpers.wait() + helpers.poke_eventloop() screen:expect([[ aa | bb | diff --git a/test/functional/legacy/051_highlight_spec.lua b/test/functional/legacy/051_highlight_spec.lua index 0c9c9621ee..d3f2897493 100644 --- a/test/functional/legacy/051_highlight_spec.lua +++ b/test/functional/legacy/051_highlight_spec.lua @@ -5,7 +5,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed = helpers.clear, helpers.feed local expect = helpers.expect local eq = helpers.eq -local wait = helpers.wait +local poke_eventloop = helpers.poke_eventloop local exc_exec = helpers.exc_exec local feed_command = helpers.feed_command @@ -34,7 +34,7 @@ describe(':highlight', function() -- More --^ | ]]) feed('q') - wait() -- wait until we're back to normal + poke_eventloop() -- wait until we're back to normal feed_command('hi Search') feed_command('hi Normal') diff --git a/test/functional/legacy/057_sort_spec.lua b/test/functional/legacy/057_sort_spec.lua index bdc2c9779c..328d6f6fa0 100644 --- a/test/functional/legacy/057_sort_spec.lua +++ b/test/functional/legacy/057_sort_spec.lua @@ -2,8 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) -local insert, command, clear, expect, eq, wait = helpers.insert, - helpers.command, helpers.clear, helpers.expect, helpers.eq, helpers.wait +local insert, command, clear, expect, eq, poke_eventloop = helpers.insert, + helpers.command, helpers.clear, helpers.expect, helpers.eq, helpers.poke_eventloop local exc_exec = helpers.exc_exec describe(':sort', function() @@ -27,7 +27,7 @@ describe(':sort', function() it('alphabetical', function() insert(text) - wait() + poke_eventloop() command('sort') expect([[ @@ -67,7 +67,7 @@ describe(':sort', function() b321 b321b ]]) - wait() + poke_eventloop() command('sort n') expect([[ abc @@ -92,7 +92,7 @@ describe(':sort', function() it('hexadecimal', function() insert(text) - wait() + poke_eventloop() command('sort x') expect([[ @@ -114,7 +114,7 @@ describe(':sort', function() it('alphabetical, unique', function() insert(text) - wait() + poke_eventloop() command('sort u') expect([[ @@ -135,7 +135,7 @@ describe(':sort', function() it('alphabetical, reverse', function() insert(text) - wait() + poke_eventloop() command('sort!') expect([[ c321d @@ -157,7 +157,7 @@ describe(':sort', function() it('numerical, reverse', function() insert(text) - wait() + poke_eventloop() command('sort! n') expect([[ b322b @@ -179,7 +179,7 @@ describe(':sort', function() it('unique, reverse', function() insert(text) - wait() + poke_eventloop() command('sort! u') expect([[ c321d @@ -200,7 +200,7 @@ describe(':sort', function() it('octal', function() insert(text) - wait() + poke_eventloop() command('sort o') expect([[ abc @@ -222,7 +222,7 @@ describe(':sort', function() it('reverse, hexadecimal', function() insert(text) - wait() + poke_eventloop() command('sort! x') expect([[ c321d @@ -244,7 +244,7 @@ describe(':sort', function() it('alphabetical, skip first character', function() insert(text) - wait() + poke_eventloop() command('sort/./') expect([[ a @@ -266,7 +266,7 @@ describe(':sort', function() it('alphabetical, skip first 2 characters', function() insert(text) - wait() + poke_eventloop() command('sort/../') expect([[ ab @@ -288,7 +288,7 @@ describe(':sort', function() it('alphabetical, unique, skip first 2 characters', function() insert(text) - wait() + poke_eventloop() command('sort/../u') expect([[ ab @@ -309,7 +309,7 @@ describe(':sort', function() it('numerical, skip first character', function() insert(text) - wait() + poke_eventloop() command('sort/./n') expect([[ abc @@ -331,7 +331,7 @@ describe(':sort', function() it('alphabetical, sort on first character', function() insert(text) - wait() + poke_eventloop() command('sort/./r') expect([[ @@ -353,7 +353,7 @@ describe(':sort', function() it('alphabetical, sort on first 2 characters', function() insert(text) - wait() + poke_eventloop() command('sort/../r') expect([[ |