mirror of
https://github.com/neovim/neovim.git
synced 2026-04-05 07:09:23 +00:00
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:
@@ -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', {}))
|
||||
|
||||
Reference in New Issue
Block a user