mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 04:28:33 +00:00
test/helpers: add 'vim_init' helper
- Initializes some global variables. - Necessary for the buffer tests in PR #904.
This commit is contained in:
@@ -97,6 +97,17 @@ cstr = ffi.typeof 'char[?]'
|
|||||||
to_cstr = (string) ->
|
to_cstr = (string) ->
|
||||||
cstr (string.len string) + 1, string
|
cstr (string.len string) + 1, string
|
||||||
|
|
||||||
|
export vim_init_called
|
||||||
|
-- initialize some global variables, this is still necessary to unit test
|
||||||
|
-- functions that rely on global state.
|
||||||
|
vim_init = ->
|
||||||
|
if vim_init_called ~= nil
|
||||||
|
return
|
||||||
|
-- import os_unix.h for mch_early_init(), which initializes some globals
|
||||||
|
os = cimport './src/nvim/os_unix.h'
|
||||||
|
os.mch_early_init!
|
||||||
|
vim_init_called = true
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cimport: cimport
|
cimport: cimport
|
||||||
cppimport: cppimport
|
cppimport: cppimport
|
||||||
@@ -107,4 +118,5 @@ return {
|
|||||||
lib: libnvim
|
lib: libnvim
|
||||||
cstr: cstr
|
cstr: cstr
|
||||||
to_cstr: to_cstr
|
to_cstr: to_cstr
|
||||||
|
vim_init: vim_init
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user