mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: Ensure proper initialization in unit/helpers.lua
Remove helpers.vim_init and simply perform the required initialization in helpers.lua.
This commit is contained in:
parent
bfadf5a28b
commit
c8c5af5a7a
@ -3,8 +3,6 @@ local helpers = require("test.unit.helpers")
|
|||||||
local to_cstr = helpers.to_cstr
|
local to_cstr = helpers.to_cstr
|
||||||
local eq = helpers.eq
|
local eq = helpers.eq
|
||||||
|
|
||||||
helpers.vim_init()
|
|
||||||
|
|
||||||
local buffer = helpers.cimport("./src/nvim/buffer.h")
|
local buffer = helpers.cimport("./src/nvim/buffer.h")
|
||||||
local window = helpers.cimport("./src/nvim/window.h")
|
local window = helpers.cimport("./src/nvim/window.h")
|
||||||
local option = helpers.cimport("./src/nvim/option.h")
|
local option = helpers.cimport("./src/nvim/option.h")
|
||||||
|
@ -136,15 +136,11 @@ end
|
|||||||
|
|
||||||
-- initialize some global variables, this is still necessary to unit test
|
-- initialize some global variables, this is still necessary to unit test
|
||||||
-- functions that rely on global state.
|
-- functions that rely on global state.
|
||||||
local function vim_init()
|
do
|
||||||
if vim_init_called ~= nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local main = cimport('./src/nvim/main.h')
|
local main = cimport('./src/nvim/main.h')
|
||||||
local time = cimport('./src/nvim/os/time.h')
|
local time = cimport('./src/nvim/os/time.h')
|
||||||
time.time_init()
|
time.time_init()
|
||||||
main.early_init()
|
main.early_init()
|
||||||
vim_init_called = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- C constants.
|
-- C constants.
|
||||||
@ -167,7 +163,6 @@ return {
|
|||||||
lib = libnvim,
|
lib = libnvim,
|
||||||
cstr = cstr,
|
cstr = cstr,
|
||||||
to_cstr = to_cstr,
|
to_cstr = to_cstr,
|
||||||
vim_init = vim_init,
|
|
||||||
NULL = NULL,
|
NULL = NULL,
|
||||||
OK = OK,
|
OK = OK,
|
||||||
FAIL = FAIL
|
FAIL = FAIL
|
||||||
|
@ -12,9 +12,6 @@ local NULL = helpers.NULL
|
|||||||
|
|
||||||
require('lfs')
|
require('lfs')
|
||||||
|
|
||||||
-- Needed because expand_env_esc uses the char table
|
|
||||||
helpers.vim_init()
|
|
||||||
|
|
||||||
local env = cimport('./src/nvim/os/os.h')
|
local env = cimport('./src/nvim/os/os.h')
|
||||||
|
|
||||||
describe('env function', function()
|
describe('env function', function()
|
||||||
|
@ -4,8 +4,6 @@ local helpers = require 'test.unit.helpers'
|
|||||||
local os = helpers.cimport './src/nvim/os/os.h'
|
local os = helpers.cimport './src/nvim/os/os.h'
|
||||||
local tempfile = helpers.cimport './src/nvim/tempfile.h'
|
local tempfile = helpers.cimport './src/nvim/tempfile.h'
|
||||||
|
|
||||||
helpers.vim_init()
|
|
||||||
|
|
||||||
describe('tempfile related functions', function()
|
describe('tempfile related functions', function()
|
||||||
after_each(function()
|
after_each(function()
|
||||||
tempfile.vim_deltempdir()
|
tempfile.vim_deltempdir()
|
||||||
|
Loading…
Reference in New Issue
Block a user