From 179c51319df0bc6f75a1376a0ca337c34d0a0b87 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 21 Nov 2014 13:06:03 -0300 Subject: 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). - (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. --- test/functional/shell/viml_system_spec.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test/functional/shell/viml_system_spec.lua') diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua index 91e115aedf..84c8765b48 100644 --- a/test/functional/shell/viml_system_spec.lua +++ b/test/functional/shell/viml_system_spec.lua @@ -10,6 +10,7 @@ local eq, clear, eval, feed, nvim = local function create_file_with_nuls(name) return function() feed('ipart1000part2000part3:w '..name..'') + eval('1') -- wait for the file to be created end end -- cgit