diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-18 21:50:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-18 21:50:57 +0200 |
commit | 1cbe0145695bea4168b4e23f61e29e51684088e1 (patch) | |
tree | 67e894a87ed21808c41eb84b6406c370311c4943 /test/unit | |
parent | aa610690bf9e525fcd172def37e14505ac449cf2 (diff) | |
parent | 9d7aaf7149a5543b1ddfc89fb506a1019bec3ffb (diff) | |
download | rneovim-1cbe0145695bea4168b4e23f61e29e51684088e1.tar.gz rneovim-1cbe0145695bea4168b4e23f61e29e51684088e1.tar.bz2 rneovim-1cbe0145695bea4168b4e23f61e29e51684088e1.zip |
Merge #9301 'runtime/lua'
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/eval/typval_spec.lua | 6 | ||||
-rw-r--r-- | test/unit/helpers.lua | 5 | ||||
-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 |
5 files changed, 13 insertions, 24 deletions
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/helpers.lua b/test/unit/helpers.lua index beb25f25db..e634b7296e 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -15,7 +15,6 @@ local dedent = global_helpers.dedent local neq = global_helpers.neq local map = global_helpers.map local eq = global_helpers.eq -local ok = global_helpers.ok -- C constants. local NULL = ffi.cast('void*', 0) @@ -842,9 +841,6 @@ local module = { cimport = cimport, cppimport = cppimport, internalize = internalize, - ok = ok, - eq = eq, - neq = neq, ffi = ffi, lib = lib, cstr = cstr, @@ -869,6 +865,7 @@ local module = { ptr2key = ptr2key, debug_log = debug_log, } +module = global_helpers.tbl_extend('error', module, global_helpers) return function() return module end 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') |