mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test/helpers: add 'vim_init' helper
- Initializes some global variables. - Necessary for the buffer tests in PR #904.
This commit is contained in:
parent
32ddfec84f
commit
c376cf46bf
@ -97,6 +97,17 @@ cstr = ffi.typeof 'char[?]'
|
||||
to_cstr = (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 {
|
||||
cimport: cimport
|
||||
cppimport: cppimport
|
||||
@ -107,4 +118,5 @@ return {
|
||||
lib: libnvim
|
||||
cstr: cstr
|
||||
to_cstr: to_cstr
|
||||
vim_init: vim_init
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user