mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
test: Refactor functional helpers to use vim_input
The vim_input function accepts raw terminal input and so is better to emulate real user, especially because it is not deferred as vim_feedkeys. Using this function required a number of changes: - expect() was refactored to use curbuf_contents() - The vim_eval function in request() was moved to curbuf_contents(). For most cases this is enough(we only care for synchronizing api calls with user input when verifying buffer contents). - <C-@>(NUL) is preprocessed before being passed to replace_termcodes. - Legacy test 4 had a bug that only became visible when using vim_input, it is fixed now. - An extra blank line deletion was required for test 101 The last two items show that vim_feedkeys because it is not 100% equivalent to receiving terminal input.
This commit is contained in:
@@ -10,6 +10,7 @@ local eq, clear, eval, feed, nvim =
|
||||
local function create_file_with_nuls(name)
|
||||
return function()
|
||||
feed('ipart1<C-V>000part2<C-V>000part3<ESC>:w '..name..'<CR>')
|
||||
eval('1') -- wait for the file to be created
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user