refactor(tests): introduce testprg()

Also:
- Add a describe('shell :!') section to system_spec.
- Make the test for #16271 work on systems without powershell.
This commit is contained in:
Justin M. Keyes
2022-06-22 05:51:52 -07:00
committed by Christian Clason
parent 175892fa37
commit 71e2c49b17
22 changed files with 116 additions and 104 deletions

View File

@@ -7,7 +7,7 @@ local eval = helpers.eval
local meths = helpers.meths
local exec_capture = helpers.exec_capture
local source = helpers.source
local nvim_dir = helpers.nvim_dir
local testprg = helpers.testprg
before_each(clear)
@@ -59,7 +59,7 @@ describe(':let', function()
end)
it("multibyte env var to child process #8398 #9267", function()
local cmd_get_child_env = "let g:env_from_child = system(['"..nvim_dir.."/printenv-test', 'NVIM_TEST'])"
local cmd_get_child_env = ("let g:env_from_child = system(['%s', 'NVIM_TEST'])"):format(testprg('printenv-test'))
command("let $NVIM_TEST = 'AìaB'")
command(cmd_get_child_env)
eq(eval('$NVIM_TEST'), eval('g:env_from_child'))