diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-12-07 14:58:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-08 06:58:03 +0800 |
commit | 5e3c1b976ab4664bde2f546ac15510f4d888a39e (patch) | |
tree | f4bd0e2f0eaa00ee4d34a5907a91dbbd9e19e561 /test/functional/core/startup_spec.lua | |
parent | 75aaec1b60e81742c01156e6884e6df977a1803e (diff) | |
download | rneovim-5e3c1b976ab4664bde2f546ac15510f4d888a39e.tar.gz rneovim-5e3c1b976ab4664bde2f546ac15510f4d888a39e.tar.bz2 rneovim-5e3c1b976ab4664bde2f546ac15510f4d888a39e.zip |
test: fix Windows tests failures (#26461)
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r-- | test/functional/core/startup_spec.lua | 83 |
1 files changed, 57 insertions, 26 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 1460870774..54259d2f5a 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -69,8 +69,17 @@ describe('startup', function() local screen screen = Screen.new(60, 7) screen:attach() - command([[let g:id = termopen('"]]..nvim_prog.. - [[" -u NONE -i NONE --cmd "set noruler" -D')]]) + local id = funcs.termopen({ + nvim_prog, + '-u', 'NONE', + '-i', 'NONE', + '--cmd', 'set noruler', + '-D' + }, { + env = { + VIMRUNTIME = os.getenv('VIMRUNTIME'), + }, + }) screen:expect([[ ^ | | @@ -80,7 +89,7 @@ describe('startup', function() > | | ]]) - command([[call chansend(g:id, "cont\n")]]) + funcs.chansend(id, 'cont\n') screen:expect([[ ^ | ~ | @@ -285,10 +294,17 @@ describe('startup', function() command([[set shellcmdflag=/s\ /c shellxquote=\"]]) end -- Running in :terminal - command([[exe printf("terminal %s -u NONE -i NONE --cmd \"]] - ..nvim_set..[[\"]] - ..[[ -c \"echo has('ttyin') has('ttyout')\""]] - ..[[, shellescape(v:progpath))]]) + funcs.termopen({ + nvim_prog, + '-u', 'NONE', + '-i', 'NONE', + '--cmd', nvim_set, + '-c', 'echo has("ttyin") has("ttyout")', + }, { + env = { + VIMRUNTIME = os.getenv('VIMRUNTIME'), + }, + }) screen:expect([[ ^ | ~ | @@ -306,11 +322,13 @@ describe('startup', function() os.remove('Xtest_startup_ttyout') end) -- Running in :terminal - command([[exe printf("terminal %s -u NONE -i NONE --cmd \"]] - ..nvim_set..[[\"]] - ..[[ -c \"call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')\"]] - ..[[ -c q | cat -v"]] -- Output to a pipe. - ..[[, shellescape(v:progpath))]]) + funcs.termopen(([["%s" -u NONE -i NONE --cmd "%s"]] + ..[[ -c "call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')"]] + ..[[ -c q | cat -v]]):format(nvim_prog, nvim_set), { + env = { + VIMRUNTIME = os.getenv('VIMRUNTIME'), + }, + }) retry(nil, 3000, function() sleep(1) eq('1\n0\n', -- stdin is a TTY, stdout is a pipe @@ -327,12 +345,14 @@ describe('startup', function() os.remove('Xtest_startup_ttyout') end) -- Running in :terminal - command([[exe printf("terminal echo foo | ]] -- Input from a pipe. - ..[[%s -u NONE -i NONE --cmd \"]] - ..nvim_set..[[\"]] - ..[[ -c \"call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')\"]] - ..[[ -c q -- -"]] - ..[[, shellescape(v:progpath))]]) + funcs.termopen(([[echo foo | ]] -- Input from a pipe. + ..[["%s" -u NONE -i NONE --cmd "%s"]] + ..[[ -c "call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')"]] + ..[[ -c q -- -]]):format(nvim_prog, nvim_set), { + env = { + VIMRUNTIME = os.getenv('VIMRUNTIME'), + }, + }) retry(nil, 3000, function() sleep(1) eq('0\n1\n', -- stdin is a pipe, stdout is a TTY @@ -347,11 +367,13 @@ describe('startup', function() command([[set shellcmdflag=/s\ /c shellxquote=\"]]) end -- Running in :terminal - command([[exe printf("terminal echo foo | ]] -- Input from a pipe. - ..[[%s -u NONE -i NONE --cmd \"]] - ..nvim_set..[[\"]] - ..[[ -c \"echo has('ttyin') has('ttyout')\""]] - ..[[, shellescape(v:progpath))]]) + funcs.termopen(([[echo foo | ]] + .. [["%s" -u NONE -i NONE --cmd "%s"]] + .. [[ -c "echo has('ttyin') has('ttyout')"]]):format(nvim_prog, nvim_set), { + env = { + VIMRUNTIME = os.getenv('VIMRUNTIME'), + }, + }) screen:expect([[ ^foo | ~ | @@ -453,8 +475,17 @@ describe('startup', function() local screen screen = Screen.new(60, 6) screen:attach() - command([[let g:id = termopen('"]]..nvim_prog.. - [[" -u NONE -i NONE --cmd "set noruler" --cmd "let g:foo = g:bar"')]]) + local id = funcs.termopen({ + nvim_prog, + '-u', 'NONE', + '-i', 'NONE', + '--cmd', 'set noruler', + '--cmd', 'let g:foo = g:bar', + }, { + env = { + VIMRUNTIME = os.getenv('VIMRUNTIME'), + }, + }) screen:expect([[ ^ | | @@ -463,7 +494,7 @@ describe('startup', function() Press ENTER or type command to continue | | ]]) - command([[call chansend(g:id, "\n")]]) + funcs.chansend(id, '\n') screen:expect([[ ^ | ~ | |