test: use exec_capture() in more places (#22787)

Problem:
Using `meths.exec2("code", { output = true })` is too verbose.

Solution:
Use exec_capture() in more places.
This commit is contained in:
zeertzjq
2023-03-26 10:49:32 +08:00
committed by GitHub
parent 4eef5ac453
commit 4863ca6b89
14 changed files with 49 additions and 45 deletions

View File

@@ -681,13 +681,13 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
end)
it('can set <expr> mappings whose RHS change dynamically', function()
meths.exec2([[
exec([[
function! FlipFlop() abort
if !exists('g:flip') | let g:flip = 0 | endif
let g:flip = !g:flip
return g:flip
endfunction
]], { output = false })
]])
eq(1, meths.call_function('FlipFlop', {}))
eq(0, meths.call_function('FlipFlop', {}))
eq(1, meths.call_function('FlipFlop', {}))