diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-18 14:09:43 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-05-18 15:48:13 +0200 |
commit | fd04877eb087b64d744a20db643f3abd630c70aa (patch) | |
tree | f5dadcc24cba5b83157657143a2aa9c0d91d6473 | |
parent | 7669fc1e9b9dba015597974f4a2b46f2439b48da (diff) | |
download | rneovim-fd04877eb087b64d744a20db643f3abd630c70aa.tar.gz rneovim-fd04877eb087b64d744a20db643f3abd630c70aa.tar.bz2 rneovim-fd04877eb087b64d744a20db643f3abd630c70aa.zip |
test: remove use of require('test.helpers')
The test.functional.helpers and test.unit.helpers modules now include
all of the public functions from test.helpers, so there is no need to
separately require('test.helpers').
-rw-r--r-- | test/functional/api/keymap_spec.lua | 5 | ||||
-rw-r--r-- | test/functional/api/vim_spec.lua | 9 | ||||
-rw-r--r-- | test/functional/core/channels_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/eval/let_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/helpers.lua | 1 | ||||
-rw-r--r-- | test/functional/options/defaults_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/ui/options_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 7 | ||||
-rw-r--r-- | test/functional/ui/wildmode_spec.lua | 3 | ||||
-rw-r--r-- | test/unit/eval/typval_spec.lua | 6 | ||||
-rw-r--r-- | test/unit/undo_spec.lua | 8 | ||||
-rw-r--r-- | test/unit/viml/expressions/lexer_spec.lua | 6 | ||||
-rw-r--r-- | test/unit/viml/expressions/parser_spec.lua | 12 |
14 files changed, 27 insertions, 45 deletions
diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index c150787425..b3f6bb7895 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -1,5 +1,4 @@ local helpers = require('test.functional.helpers')(after_each) -local global_helpers = require('test.helpers') local bufmeths = helpers.bufmeths local clear = helpers.clear @@ -12,8 +11,8 @@ local funcs = helpers.funcs local meths = helpers.meths local source = helpers.source -local shallowcopy = global_helpers.shallowcopy -local sleep = global_helpers.sleep +local shallowcopy = helpers.shallowcopy +local sleep = helpers.sleep describe('nvim_get_keymap', function() before_each(clear) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 2178abab53..a7d8dc59ec 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1,6 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local global_helpers = require('test.helpers') local NIL = helpers.NIL local clear, nvim, eq, neq = helpers.clear, helpers.nvim, helpers.eq, helpers.neq @@ -16,10 +15,10 @@ local request = helpers.request local source = helpers.source local next_msg = helpers.next_msg -local expect_err = global_helpers.expect_err -local format_string = global_helpers.format_string -local intchar2lua = global_helpers.intchar2lua -local mergedicts_copy = global_helpers.mergedicts_copy +local expect_err = helpers.expect_err +local format_string = helpers.format_string +local intchar2lua = helpers.intchar2lua +local mergedicts_copy = helpers.mergedicts_copy describe('API', function() before_each(clear) diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua index 0137092eb5..ddaed1c448 100644 --- a/test/functional/core/channels_spec.lua +++ b/test/functional/core/channels_spec.lua @@ -1,7 +1,5 @@ -local global_helpers = require('test.helpers') -local uname = global_helpers.uname - local helpers = require('test.functional.helpers')(after_each) +local uname = helpers.uname local clear, eq, eval, next_msg, ok, source = helpers.clear, helpers.eq, helpers.eval, helpers.next_msg, helpers.ok, helpers.source local command, funcs, meths = helpers.command, helpers.funcs, helpers.meths diff --git a/test/functional/eval/let_spec.lua b/test/functional/eval/let_spec.lua index 0cbf40137e..63e18f943f 100644 --- a/test/functional/eval/let_spec.lua +++ b/test/functional/eval/let_spec.lua @@ -59,7 +59,7 @@ describe(':let', function() end) it("multibyte env var to child process #8398 #9267", function() - if (not helpers.iswin()) and require('test.helpers').isCI() then + if (not helpers.iswin()) and helpers.isCI() then -- Fails on non-Windows CI. Buffering/timing issue? pending('fails on unix CI', function() end) end diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 101d456165..d0dd634c8c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -16,7 +16,6 @@ local eq = global_helpers.eq local ok = global_helpers.ok local sleep = global_helpers.sleep local table_contains = global_helpers.table_contains -local table_flatten = global_helpers.table_flatten local write_file = global_helpers.write_file local start_dir = lfs.currentdir() diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index 0fc2876d00..9ff2666ad4 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -1,5 +1,4 @@ local helpers = require('test.functional.helpers')(after_each) -local global_helpers = require('test.helpers') local Screen = require('test.functional.ui.screen') @@ -16,7 +15,7 @@ local neq = helpers.neq local mkdir = helpers.mkdir local rmdir = helpers.rmdir local alter_slashes = helpers.alter_slashes -local table_contains = global_helpers.table_contains +local table_contains = helpers.table_contains describe('startup defaults', function() describe(':filetype', function() diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 469d088c57..56d6f68b7a 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -1,8 +1,7 @@ -- TUI acceptance tests. -- Uses :terminal as a way to send keys and assert screen state. -local global_helpers = require('test.helpers') -local uname = global_helpers.uname local helpers = require('test.functional.helpers')(after_each) +local uname = helpers.uname local thelpers = require('test.functional.terminal.helpers') local Screen = require('test.functional.ui.screen') local eq = helpers.eq diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua index 7ce21f5d76..93192934c7 100644 --- a/test/functional/ui/options_spec.lua +++ b/test/functional/ui/options_spec.lua @@ -1,10 +1,9 @@ -local global_helpers = require('test.helpers') local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear = helpers.clear local command = helpers.command local eq = helpers.eq -local shallowcopy = global_helpers.shallowcopy +local shallowcopy = helpers.shallowcopy describe('ui receives option updates', function() local screen diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 53b6642207..a81851cbba 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -71,11 +71,10 @@ -- To help write screen tests, see Screen:snapshot_util(). -- To debug screen tests, see Screen:redraw_debug(). -local global_helpers = require('test.helpers') -local deepcopy = global_helpers.deepcopy -local shallowcopy = global_helpers.shallowcopy -local concat_tables = global_helpers.concat_tables local helpers = require('test.functional.helpers')(nil) +local deepcopy = helpers.deepcopy +local shallowcopy = helpers.shallowcopy +local concat_tables = helpers.concat_tables local request, run_session = helpers.request, helpers.run_session local eq = helpers.eq local dedent = helpers.dedent diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index 1c8854bb28..f4b80fd428 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -1,7 +1,6 @@ -local global_helpers = require('test.helpers') -local shallowcopy = global_helpers.shallowcopy local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') +local shallowcopy = helpers.shallowcopy local clear, feed, command = helpers.clear, helpers.feed, helpers.command local iswin = helpers.iswin local funcs = helpers.funcs diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 919a42fbb9..4535d6a0b2 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -1,7 +1,6 @@ local bit = require('bit') local helpers = require('test.unit.helpers')(after_each) local eval_helpers = require('test.unit.eval.helpers') -local global_helpers = require('test.helpers') local itp = helpers.gen_itp(it) @@ -14,6 +13,8 @@ local NULL = helpers.NULL local cimport = helpers.cimport local to_cstr = helpers.to_cstr local alloc_log_new = helpers.alloc_log_new +local concat_tables = helpers.concat_tables +local map = helpers.map local a = eval_helpers.alloc_logging_helpers local int = eval_helpers.int @@ -40,9 +41,6 @@ local callback2tbl = eval_helpers.callback2tbl local tbl2callback = eval_helpers.tbl2callback local dict_watchers = eval_helpers.dict_watchers -local concat_tables = global_helpers.concat_tables -local map = global_helpers.map - local lib = cimport('./src/nvim/eval/typval.h', './src/nvim/memory.h', './src/nvim/mbyte.h', './src/nvim/garray.h', './src/nvim/eval.h', './src/nvim/vim.h', diff --git a/test/unit/undo_spec.lua b/test/unit/undo_spec.lua index f23110b329..616c6fbe3d 100644 --- a/test/unit/undo_spec.lua +++ b/test/unit/undo_spec.lua @@ -2,9 +2,7 @@ local helpers = require('test.unit.helpers')(after_each) local itp = helpers.gen_itp(it) local lfs = require('lfs') local child_call_once = helpers.child_call_once - -local global_helpers = require('test.helpers') -local sleep = global_helpers.sleep +local sleep = helpers.sleep local ffi = helpers.ffi local cimport = helpers.cimport @@ -156,12 +154,12 @@ describe('u_write_undo', function() local file_contents = "testing permissions" -- Write a text file where the undofile should go local correct_name = ffi.string(undo.u_get_undo_file_name(file_buffer.b_ffname, false)) - global_helpers.write_file(correct_name, file_contents, true, false) + helpers.write_file(correct_name, file_contents, true, false) -- Call with `forceit`. u_write_undo(correct_name, true, file_buffer, buffer_hash) - local undo_file_contents = global_helpers.read_file(correct_name) + local undo_file_contents = helpers.read_file(correct_name) neq(file_contents, undo_file_contents) local success, deletion_err = os.remove(correct_name) -- delete the file now that we're done with it. diff --git a/test/unit/viml/expressions/lexer_spec.lua b/test/unit/viml/expressions/lexer_spec.lua index 1b57a24ad5..358e858d61 100644 --- a/test/unit/viml/expressions/lexer_spec.lua +++ b/test/unit/viml/expressions/lexer_spec.lua @@ -1,5 +1,4 @@ local helpers = require('test.unit.helpers')(after_each) -local global_helpers = require('test.helpers') local itp = helpers.gen_itp(it) local viml_helpers = require('test.unit.viml.helpers') @@ -8,6 +7,8 @@ local conv_enum = helpers.conv_enum local cimport = helpers.cimport local ffi = helpers.ffi local eq = helpers.eq +local shallowcopy = helpers.shallowcopy +local intchar2lua = helpers.intchar2lua local conv_ccs = viml_helpers.conv_ccs local new_pstate = viml_helpers.new_pstate @@ -15,9 +16,6 @@ local conv_cmp_type = viml_helpers.conv_cmp_type local pstate_set_str = viml_helpers.pstate_set_str local conv_expr_asgn_type = viml_helpers.conv_expr_asgn_type -local shallowcopy = global_helpers.shallowcopy -local intchar2lua = global_helpers.intchar2lua - local lib = cimport('./src/nvim/viml/parser/expressions.h') local eltkn_type_tab, eltkn_mul_type_tab, eltkn_opt_scope_tab diff --git a/test/unit/viml/expressions/parser_spec.lua b/test/unit/viml/expressions/parser_spec.lua index 73388e5dd2..a8f29529ec 100644 --- a/test/unit/viml/expressions/parser_spec.lua +++ b/test/unit/viml/expressions/parser_spec.lua @@ -1,5 +1,4 @@ local helpers = require('test.unit.helpers')(after_each) -local global_helpers = require('test.helpers') local itp = helpers.gen_itp(it) local viml_helpers = require('test.unit.viml.helpers') @@ -14,6 +13,11 @@ local cimport = helpers.cimport local ffi = helpers.ffi local neq = helpers.neq local eq = helpers.eq +local mergedicts_copy = helpers.mergedicts_copy +local format_string = helpers.format_string +local format_luav = helpers.format_luav +local intchar2lua = helpers.intchar2lua +local dictdiff = helpers.dictdiff local conv_ccs = viml_helpers.conv_ccs local new_pstate = viml_helpers.new_pstate @@ -21,12 +25,6 @@ local conv_cmp_type = viml_helpers.conv_cmp_type local pstate_set_str = viml_helpers.pstate_set_str local conv_expr_asgn_type = viml_helpers.conv_expr_asgn_type -local mergedicts_copy = global_helpers.mergedicts_copy -local format_string = global_helpers.format_string -local format_luav = global_helpers.format_luav -local intchar2lua = global_helpers.intchar2lua -local dictdiff = global_helpers.dictdiff - local lib = cimport('./src/nvim/viml/parser/expressions.h', './src/nvim/syntax.h') |