diff options
| author | dundargoc <gocdundar@gmail.com> | 2024-04-08 11:03:20 +0200 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-04-08 22:51:00 +0200 |
| commit | 7035125b2b26aa68fcfb7cda39377ac79926a0f9 (patch) | |
| tree | d194a3556a367b42505f9e7d26637e7cb3674928 /test/functional/editor | |
| parent | 978962f9a00ce75216d2c36b79397ef3d2b54096 (diff) | |
| download | rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.tar.gz rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.tar.bz2 rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.zip | |
test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
Diffstat (limited to 'test/functional/editor')
| -rw-r--r-- | test/functional/editor/K_spec.lua | 15 | ||||
| -rw-r--r-- | test/functional/editor/completion_spec.lua | 18 | ||||
| -rw-r--r-- | test/functional/editor/count_spec.lua | 12 | ||||
| -rw-r--r-- | test/functional/editor/ctrl_c_spec.lua | 10 | ||||
| -rw-r--r-- | test/functional/editor/fold_spec.lua | 28 | ||||
| -rw-r--r-- | test/functional/editor/jump_spec.lua | 20 | ||||
| -rw-r--r-- | test/functional/editor/lang_spec.lua | 10 | ||||
| -rw-r--r-- | test/functional/editor/langmap_spec.lua | 21 | ||||
| -rw-r--r-- | test/functional/editor/macro_spec.lua | 22 | ||||
| -rw-r--r-- | test/functional/editor/mark_spec.lua | 44 | ||||
| -rw-r--r-- | test/functional/editor/meta_key_spec.lua | 16 | ||||
| -rw-r--r-- | test/functional/editor/mode_cmdline_spec.lua | 11 | ||||
| -rw-r--r-- | test/functional/editor/mode_insert_spec.lua | 20 | ||||
| -rw-r--r-- | test/functional/editor/mode_normal_spec.lua | 12 | ||||
| -rw-r--r-- | test/functional/editor/put_spec.lua | 26 | ||||
| -rw-r--r-- | test/functional/editor/search_spec.lua | 10 | ||||
| -rw-r--r-- | test/functional/editor/tabpage_spec.lua | 24 | ||||
| -rw-r--r-- | test/functional/editor/undo_spec.lua | 28 |
18 files changed, 171 insertions, 176 deletions
diff --git a/test/functional/editor/K_spec.lua b/test/functional/editor/K_spec.lua index 1fbdd1c142..9feb878378 100644 --- a/test/functional/editor/K_spec.lua +++ b/test/functional/editor/K_spec.lua @@ -1,6 +1,5 @@ -local helpers = require('test.functional.helpers')(after_each) -local eq, clear, eval, feed, api, retry = - helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.api, helpers.retry +local t = require('test.functional.testutil')(after_each) +local eq, clear, eval, feed, api, retry = t.eq, t.clear, t.eval, t.feed, t.api, t.retry describe('K', function() local test_file = 'K_spec_out' @@ -13,19 +12,19 @@ describe('K', function() end) it("invokes colon-prefixed 'keywordprg' as Vim command", function() - helpers.source([[ + t.source([[ let @a='fnord' set keywordprg=:put]]) -- K on the text "a" resolves to `:put a`. feed('ia<ESC>K') - helpers.expect([[ + t.expect([[ a fnord]]) end) it("invokes non-prefixed 'keywordprg' as shell command", function() - helpers.source([[ + t.source([[ let @a='fnord' set keywordprg=echo\ fnord>>]]) @@ -43,7 +42,7 @@ describe('K', function() end) it("<esc> kills the buffer for a running 'keywordprg' command", function() - helpers.source('set keywordprg=less') + t.source('set keywordprg=less') eval('writefile(["hello", "world"], "' .. test_file .. '")') feed('i' .. test_file .. '<esc>K') eq('t', eval('mode()')) @@ -57,7 +56,7 @@ describe('K', function() local bufnr = eval('bufnr()') feed('<esc>') eq('n', eval('mode()')) - helpers.neq(bufnr, eval('bufnr()')) + t.neq(bufnr, eval('bufnr()')) end) it('empty string falls back to :help #19298', function() diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index 33d0d47499..45cfb062ad 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -1,13 +1,13 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -local assert_alive = helpers.assert_alive -local clear, feed = helpers.clear, helpers.feed -local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq -local feed_command, source, expect = helpers.feed_command, helpers.source, helpers.expect -local fn = helpers.fn -local command = helpers.command -local api = helpers.api -local poke_eventloop = helpers.poke_eventloop +local assert_alive = t.assert_alive +local clear, feed = t.clear, t.feed +local eval, eq, neq = t.eval, t.eq, t.neq +local feed_command, source, expect = t.feed_command, t.source, t.expect +local fn = t.fn +local command = t.command +local api = t.api +local poke_eventloop = t.poke_eventloop describe('completion', function() local screen diff --git a/test/functional/editor/count_spec.lua b/test/functional/editor/count_spec.lua index 94f741250a..808460520b 100644 --- a/test/functional/editor/count_spec.lua +++ b/test/functional/editor/count_spec.lua @@ -1,10 +1,10 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) -local eq = helpers.eq -local eval = helpers.eval -local feed = helpers.feed -local clear = helpers.clear -local command = helpers.command +local eq = t.eq +local eval = t.eval +local feed = t.feed +local clear = t.clear +local command = t.command describe('v:count/v:count1', function() before_each(function() diff --git a/test/functional/editor/ctrl_c_spec.lua b/test/functional/editor/ctrl_c_spec.lua index f5eb98cc8d..ff12f5db0d 100644 --- a/test/functional/editor/ctrl_c_spec.lua +++ b/test/functional/editor/ctrl_c_spec.lua @@ -1,8 +1,8 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -local clear, feed, source = helpers.clear, helpers.feed, helpers.source -local command = helpers.command -local poke_eventloop = helpers.poke_eventloop +local clear, feed, source = t.clear, t.feed, t.source +local command = t.command +local poke_eventloop = t.poke_eventloop local sleep = vim.uv.sleep describe('CTRL-C (mapped)', function() @@ -16,7 +16,7 @@ describe('CTRL-C (mapped)', function() it('interrupts :global', function() -- Crashes luajit. - if helpers.skip_fragile(pending) then + if t.skip_fragile(pending) then return end diff --git a/test/functional/editor/fold_spec.lua b/test/functional/editor/fold_spec.lua index 7950f6aea4..e0c986f55f 100644 --- a/test/functional/editor/fold_spec.lua +++ b/test/functional/editor/fold_spec.lua @@ -1,14 +1,14 @@ -local helpers = require('test.functional.helpers')(after_each) - -local clear = helpers.clear -local insert = helpers.insert -local exec = helpers.exec -local feed = helpers.feed -local expect = helpers.expect -local command = helpers.command -local fn = helpers.fn -local eq = helpers.eq -local neq = helpers.neq +local t = require('test.functional.testutil')(after_each) + +local clear = t.clear +local insert = t.insert +local exec = t.exec +local feed = t.feed +local expect = t.expect +local command = t.command +local fn = t.fn +local eq = t.eq +local neq = t.neq describe('Folding', function() local tempfname = 'Xtest-fold.txt' @@ -301,7 +301,7 @@ a]], it('updates correctly on :read', function() -- luacheck: ignore 621 - helpers.write_file( + t.write_file( tempfname, [[ a @@ -376,7 +376,7 @@ a]], end) it('splits folds according to >N and <N with foldexpr', function() - helpers.source([[ + t.source([[ function TestFoldExpr(lnum) let thisline = getline(a:lnum) if thisline == 'a' @@ -391,7 +391,7 @@ a]], return 0 endfunction ]]) - helpers.write_file( + t.write_file( tempfname, [[ b diff --git a/test/functional/editor/jump_spec.lua b/test/functional/editor/jump_spec.lua index fe03d82164..ad064091d8 100644 --- a/test/functional/editor/jump_spec.lua +++ b/test/functional/editor/jump_spec.lua @@ -1,15 +1,15 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -local clear = helpers.clear -local command = helpers.command -local dedent = helpers.dedent -local eq = helpers.eq -local fn = helpers.fn -local feed = helpers.feed -local exec_capture = helpers.exec_capture -local write_file = helpers.write_file -local api = helpers.api +local clear = t.clear +local command = t.command +local dedent = t.dedent +local eq = t.eq +local fn = t.fn +local feed = t.feed +local exec_capture = t.exec_capture +local write_file = t.write_file +local api = t.api describe('jumplist', function() local fname1 = 'Xtest-functional-normal-jump' diff --git a/test/functional/editor/lang_spec.lua b/test/functional/editor/lang_spec.lua index ee7cfac057..b7154a27f8 100644 --- a/test/functional/editor/lang_spec.lua +++ b/test/functional/editor/lang_spec.lua @@ -1,8 +1,8 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear, insert, eq = helpers.clear, helpers.insert, helpers.eq -local command, expect = helpers.command, helpers.expect -local feed, eval = helpers.feed, helpers.eval -local exc_exec = helpers.exc_exec +local t = require('test.functional.testutil')(after_each) +local clear, insert, eq = t.clear, t.insert, t.eq +local command, expect = t.command, t.expect +local feed, eval = t.feed, t.eval +local exc_exec = t.exc_exec describe('gu and gU', function() before_each(clear) diff --git a/test/functional/editor/langmap_spec.lua b/test/functional/editor/langmap_spec.lua index b2a4b21a89..b569b70925 100644 --- a/test/functional/editor/langmap_spec.lua +++ b/test/functional/editor/langmap_spec.lua @@ -1,10 +1,10 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) -local eq, neq, call = helpers.eq, helpers.neq, helpers.call -local eval, feed, clear = helpers.eval, helpers.feed, helpers.clear -local command, insert, expect = helpers.command, helpers.insert, helpers.expect -local feed_command = helpers.feed_command -local curwin = helpers.api.nvim_get_current_win +local eq, neq, call = t.eq, t.neq, t.call +local eval, feed, clear = t.eval, t.feed, t.clear +local command, insert, expect = t.command, t.insert, t.expect +local feed_command = t.feed_command +local curwin = t.api.nvim_get_current_win describe("'langmap'", function() before_each(function() @@ -133,7 +133,7 @@ describe("'langmap'", function() hello]]) end) it('command-line CTRL-R', function() - helpers.source([[ + t.source([[ let i_value = 0 let j_value = 0 call setreg('i', 'i_value') @@ -171,7 +171,7 @@ describe("'langmap'", function() end) it('prompt for number', function() command('set langmap=12,21') - helpers.source([[ + t.source([[ let gotten_one = 0 function Map() let answer = inputlist(['a', '1.', '2.', '3.']) @@ -214,10 +214,7 @@ describe("'langmap'", function() end feed('qa' .. command_string .. 'q') expect(expect_string) - eq( - expect_macro or helpers.fn.nvim_replace_termcodes(command_string, true, true, true), - eval('@a') - ) + eq(expect_macro or t.fn.nvim_replace_termcodes(command_string, true, true, true), eval('@a')) if setup_function then setup_function() end diff --git a/test/functional/editor/macro_spec.lua b/test/functional/editor/macro_spec.lua index c97befdf07..86e7b8f3c8 100644 --- a/test/functional/editor/macro_spec.lua +++ b/test/functional/editor/macro_spec.lua @@ -1,14 +1,14 @@ -local helpers = require('test.functional.helpers')(after_each) - -local eq = helpers.eq -local eval = helpers.eval -local feed = helpers.feed -local clear = helpers.clear -local expect = helpers.expect -local command = helpers.command -local fn = helpers.fn -local api = helpers.api -local insert = helpers.insert +local t = require('test.functional.testutil')(after_each) + +local eq = t.eq +local eval = t.eval +local feed = t.feed +local clear = t.clear +local expect = t.expect +local command = t.command +local fn = t.fn +local api = t.api +local insert = t.insert describe('macros', function() before_each(function() diff --git a/test/functional/editor/mark_spec.lua b/test/functional/editor/mark_spec.lua index 625490ef83..ad45edd500 100644 --- a/test/functional/editor/mark_spec.lua +++ b/test/functional/editor/mark_spec.lua @@ -1,15 +1,15 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -local api = helpers.api -local clear = helpers.clear -local command = helpers.command -local fn = helpers.fn -local eq = helpers.eq -local feed = helpers.feed -local write_file = helpers.write_file -local pcall_err = helpers.pcall_err +local api = t.api +local clear = t.clear +local command = t.command +local fn = t.fn +local eq = t.eq +local feed = t.feed +local write_file = t.write_file +local pcall_err = t.pcall_err local cursor = function() - return helpers.api.nvim_win_get_cursor(0) + return t.api.nvim_win_get_cursor(0) end describe('named marks', function() @@ -39,59 +39,59 @@ describe('named marks', function() it('errors when set out of range with :mark', function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, '1000mark x') + local err = pcall_err(t.exec_capture, '1000mark x') eq('nvim_exec2(): Vim(mark):E16: Invalid range: 1000mark x', err) end) it('errors when set out of range with :k', function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, '1000kx') + local err = pcall_err(t.exec_capture, '1000kx') eq('nvim_exec2(): Vim(k):E16: Invalid range: 1000kx', err) end) it('errors on unknown mark name with :mark', function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, 'mark #') + local err = pcall_err(t.exec_capture, 'mark #') eq('nvim_exec2(): Vim(mark):E191: Argument must be a letter or forward/backward quote', err) end) it("errors on unknown mark name with '", function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, "normal! '#") + local err = pcall_err(t.exec_capture, "normal! '#") eq('nvim_exec2(): Vim(normal):E78: Unknown mark', err) end) it('errors on unknown mark name with `', function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, 'normal! `#') + local err = pcall_err(t.exec_capture, 'normal! `#') eq('nvim_exec2(): Vim(normal):E78: Unknown mark', err) end) it("errors when moving to a mark that is not set with '", function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, "normal! 'z") + local err = pcall_err(t.exec_capture, "normal! 'z") eq('nvim_exec2(): Vim(normal):E20: Mark not set', err) - err = pcall_err(helpers.exec_capture, "normal! '.") + err = pcall_err(t.exec_capture, "normal! '.") eq('nvim_exec2(): Vim(normal):E20: Mark not set', err) end) it('errors when moving to a mark that is not set with `', function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, 'normal! `z') + local err = pcall_err(t.exec_capture, 'normal! `z') eq('nvim_exec2(): Vim(normal):E20: Mark not set', err) - err = pcall_err(helpers.exec_capture, 'normal! `>') + err = pcall_err(t.exec_capture, 'normal! `>') eq('nvim_exec2(): Vim(normal):E20: Mark not set', err) end) it("errors when moving to a global mark that is not set with '", function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, "normal! 'Z") + local err = pcall_err(t.exec_capture, "normal! 'Z") eq('nvim_exec2(): Vim(normal):E20: Mark not set', err) end) it('errors when moving to a global mark that is not set with `', function() command('edit ' .. file1) - local err = pcall_err(helpers.exec_capture, 'normal! `Z') + local err = pcall_err(t.exec_capture, 'normal! `Z') eq('nvim_exec2(): Vim(normal):E20: Mark not set', err) end) @@ -166,7 +166,7 @@ describe('named marks', function() feed('mA') command('next') command('bw! ' .. file1) - local err = pcall_err(helpers.exec_capture, "normal! 'A") + local err = pcall_err(t.exec_capture, "normal! 'A") eq('nvim_exec2(): Vim(normal):E92: Buffer 1 not found', err) os.remove(file1) end) diff --git a/test/functional/editor/meta_key_spec.lua b/test/functional/editor/meta_key_spec.lua index e2bdf6ba96..97acb3d090 100644 --- a/test/functional/editor/meta_key_spec.lua +++ b/test/functional/editor/meta_key_spec.lua @@ -1,11 +1,11 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local command = helpers.command -local exec_lua = helpers.exec_lua -local eval = helpers.eval -local expect = helpers.expect -local fn = helpers.fn -local eq = helpers.eq +local t = require('test.functional.testutil')(after_each) +local clear, feed, insert = t.clear, t.feed, t.insert +local command = t.command +local exec_lua = t.exec_lua +local eval = t.eval +local expect = t.expect +local fn = t.fn +local eq = t.eq describe('meta-keys #8226 #13042', function() before_each(function() diff --git a/test/functional/editor/mode_cmdline_spec.lua b/test/functional/editor/mode_cmdline_spec.lua index 06efe53718..6347c0f063 100644 --- a/test/functional/editor/mode_cmdline_spec.lua +++ b/test/functional/editor/mode_cmdline_spec.lua @@ -1,12 +1,11 @@ -- Cmdline-mode tests. -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -local clear, insert, fn, eq, feed = - helpers.clear, helpers.insert, helpers.fn, helpers.eq, helpers.feed -local eval = helpers.eval -local command = helpers.command -local api = helpers.api +local clear, insert, fn, eq, feed = t.clear, t.insert, t.fn, t.eq, t.feed +local eval = t.eval +local command = t.command +local api = t.api describe('cmdline', function() before_each(clear) diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua index ebf118736f..1323260257 100644 --- a/test/functional/editor/mode_insert_spec.lua +++ b/test/functional/editor/mode_insert_spec.lua @@ -1,14 +1,14 @@ -- Insert-mode tests. -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -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 curbuf_contents = helpers.curbuf_contents -local api = helpers.api +local clear, feed, insert = t.clear, t.feed, t.insert +local expect = t.expect +local command = t.command +local eq = t.eq +local eval = t.eval +local curbuf_contents = t.curbuf_contents +local api = t.api describe('insert-mode', function() before_each(function() @@ -232,10 +232,10 @@ describe('insert-mode', function() end local function test_cols(expected_cols) - local cols = { { helpers.fn.col('.'), helpers.fn.virtcol('.') } } + local cols = { { t.fn.col('.'), t.fn.virtcol('.') } } for _ = 2, #expected_cols do feed('<BS>') - table.insert(cols, { helpers.fn.col('.'), helpers.fn.virtcol('.') }) + table.insert(cols, { t.fn.col('.'), t.fn.virtcol('.') }) end eq(expected_cols, cols) end diff --git a/test/functional/editor/mode_normal_spec.lua b/test/functional/editor/mode_normal_spec.lua index 89bab3f6c9..fcc13782e5 100644 --- a/test/functional/editor/mode_normal_spec.lua +++ b/test/functional/editor/mode_normal_spec.lua @@ -1,11 +1,11 @@ -- Normal mode tests. -local helpers = require('test.functional.helpers')(after_each) -local clear = helpers.clear -local feed = helpers.feed -local fn = helpers.fn -local command = helpers.command -local eq = helpers.eq +local t = require('test.functional.testutil')(after_each) +local clear = t.clear +local feed = t.feed +local fn = t.fn +local command = t.command +local eq = t.eq describe('Normal mode', function() before_each(clear) diff --git a/test/functional/editor/put_spec.lua b/test/functional/editor/put_spec.lua index 414b289222..96a1d87b8b 100644 --- a/test/functional/editor/put_spec.lua +++ b/test/functional/editor/put_spec.lua @@ -1,18 +1,18 @@ local Screen = require('test.functional.ui.screen') -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) -local clear = helpers.clear -local insert = helpers.insert -local feed = helpers.feed -local expect = helpers.expect -local eq = helpers.eq +local clear = t.clear +local insert = t.insert +local feed = t.feed +local expect = t.expect +local eq = t.eq local map = vim.tbl_map local filter = vim.tbl_filter -local feed_command = helpers.feed_command -local command = helpers.command -local curbuf_contents = helpers.curbuf_contents -local fn = helpers.fn -local dedent = helpers.dedent +local feed_command = t.feed_command +local command = t.command +local curbuf_contents = t.curbuf_contents +local fn = t.fn +local dedent = t.dedent local function reset() command('bwipe! | new') @@ -75,7 +75,7 @@ describe('put command', function() extra_setup() end local orig_dotstr = fn.getreg('.') - helpers.ok(visual_marks_zero()) + t.ok(visual_marks_zero()) -- Make sure every test starts from the same conditions assert_no_change(test.exception_table, false) local was_cli = test.test_action() @@ -890,7 +890,7 @@ describe('put command', function() -- check bell is not set by nvim before the action screen:sleep(50) end - helpers.ok(not screen.bell and not screen.visualbell) + t.ok(not screen.bell and not screen.visualbell) actions() screen:expect { condition = function() diff --git a/test/functional/editor/search_spec.lua b/test/functional/editor/search_spec.lua index 46a3e298b7..2ccbcc8865 100644 --- a/test/functional/editor/search_spec.lua +++ b/test/functional/editor/search_spec.lua @@ -1,8 +1,8 @@ -local helpers = require('test.functional.helpers')(after_each) -local clear = helpers.clear -local command = helpers.command -local eq = helpers.eq -local pcall_err = helpers.pcall_err +local t = require('test.functional.testutil')(after_each) +local clear = t.clear +local command = t.command +local eq = t.eq +local pcall_err = t.pcall_err describe('search (/)', function() before_each(clear) diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua index 0cbc2dbf3d..e77e30f9e0 100644 --- a/test/functional/editor/tabpage_spec.lua +++ b/test/functional/editor/tabpage_spec.lua @@ -1,17 +1,17 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) local Screen = require('test.functional.ui.screen') -local clear = helpers.clear -local command = helpers.command -local eq = helpers.eq -local neq = helpers.neq -local feed = helpers.feed -local eval = helpers.eval -local exec = helpers.exec -local fn = helpers.fn -local api = helpers.api -local curwin = helpers.api.nvim_get_current_win -local assert_alive = helpers.assert_alive +local clear = t.clear +local command = t.command +local eq = t.eq +local neq = t.neq +local feed = t.feed +local eval = t.eval +local exec = t.exec +local fn = t.fn +local api = t.api +local curwin = t.api.nvim_get_current_win +local assert_alive = t.assert_alive describe('tabpage', function() before_each(clear) diff --git a/test/functional/editor/undo_spec.lua b/test/functional/editor/undo_spec.lua index c101bf02a0..f6dd07054b 100644 --- a/test/functional/editor/undo_spec.lua +++ b/test/functional/editor/undo_spec.lua @@ -1,16 +1,16 @@ -local helpers = require('test.functional.helpers')(after_each) - -local clear = helpers.clear -local command = helpers.command -local eval = helpers.eval -local expect = helpers.expect -local eq = helpers.eq -local feed = helpers.feed -local feed_command = helpers.feed_command -local insert = helpers.insert -local fn = helpers.fn -local exec = helpers.exec -local exec_lua = helpers.exec_lua +local t = require('test.functional.testutil')(after_each) + +local clear = t.clear +local command = t.command +local eval = t.eval +local expect = t.expect +local eq = t.eq +local feed = t.feed +local feed_command = t.feed_command +local insert = t.insert +local fn = t.fn +local exec = t.exec +local exec_lua = t.exec_lua local function lastmessage() local messages = fn.split(fn.execute('messages'), '\n') @@ -44,7 +44,7 @@ describe('u CTRL-R g- g+', function() local function undo_and_redo(hist_pos, undo, redo, expect_str) command('enew!') create_history(hist_pos) - local cur_contents = helpers.curbuf_contents() + local cur_contents = t.curbuf_contents() feed(undo) expect(expect_str) feed(redo) |