diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua index 17156e483b..d63182109d 100644 --- a/test/functional/ex_cmds/cmd_map_spec.lua +++ b/test/functional/ex_cmds/cmd_map_spec.lua @@ -574,7 +574,7 @@ describe('mappings with ', function() eq('i', eval('mode(1)')) -- also works as part of abbreviation - feed('foo ') + feed(' foo ') screen:expect([[ in bar ^deed some short little lines | of stuff test text | diff --git a/test/functional/legacy/034_user_function_spec.lua b/test/functional/legacy/034_user_function_spec.lua index 89bf3b8920..ebac1adcb8 100644 --- a/test/functional/legacy/034_user_function_spec.lua +++ b/test/functional/legacy/034_user_function_spec.lua @@ -63,12 +63,11 @@ describe( /^here ]]) feed('C=Table("xxx", 4, "asdf")') - -- Using a actual space will not work as feed() calls dedent on the input. - feed('=Compute(45, 0, "retval")') - feed('=retval') - feed('=Compute(45, 5, "retval")') - feed('=retval') - feed('=g:FuncRef(333)') + feed(' =Compute(45, 0, "retval")') + feed(' =retval') + feed(' =Compute(45, 5, "retval")') + feed(' =retval') + feed(' =g:FuncRef(333)') feed('') feed('XX+-XX') feed('---*---') diff --git a/test/functional/legacy/069_multibyte_formatting_spec.lua b/test/functional/legacy/069_multibyte_formatting_spec.lua index 24a4692e6c..de31b8d396 100644 --- a/test/functional/legacy/069_multibyte_formatting_spec.lua +++ b/test/functional/legacy/069_multibyte_formatting_spec.lua @@ -183,9 +183,8 @@ describe('multibyte text', function() feed_command('/^{/+1') feed_command('set noai tw=2 fo=tm') feed('gqgqjgqgqo') - -- Literal spaces will be trimmed from the by feed(). - feed('') - feed('Xa') + feed(' X') + feed(' Xa') expect([[ { X diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua index c1dbc6dac3..f357aab4d6 100644 --- a/test/functional/plugin/man_spec.lua +++ b/test/functional/plugin/man_spec.lua @@ -3,6 +3,7 @@ local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local command, feed = n.command, n.feed +local dedent = t.dedent local clear = n.clear local exec_lua = n.exec_lua local fn = n.fn @@ -63,9 +64,11 @@ describe(':Man', function() it('clears backspaces from text and adds highlights', function() feed( - [[ + dedent( + [[ ithis iiss aa test with _o_v_e_r_s_t_r_u_c_k text]] + ) ) screen:expect { @@ -89,9 +92,11 @@ describe(':Man', function() it('clears escape sequences from text and adds highlights', function() feed( - [[ + dedent( + [[ ithis [1mis [3ma [4mtest[0m [4mwith[24m [4mescaped[24m [4mtext[24m]] + ) ) screen:expect { @@ -115,8 +120,10 @@ describe(':Man', function() it('clears OSC 8 hyperlink markup from text', function() feed( - [[ + dedent( + [[ ithis ]8;;http://example.com\Link Title]8;;\]] + ) ) screen:expect { @@ -138,9 +145,11 @@ describe(':Man', function() it('highlights multibyte text', function() feed( - [[ + dedent( + [[ ithis iiss ああ test with _ö_v_e_r_s_t_r_u_̃_c_k te[3mxt¶[0m]] + ) ) exec_lua [[require'man'.init_pager()]] @@ -154,10 +163,12 @@ describe(':Man', function() it('highlights underscores based on context', function() feed( - [[ + dedent( + [[ i__bbeeggiinnss mmiidd__ddllee _m_i_d___d_l_e]] + ) ) exec_lua [[require'man'.init_pager()]] @@ -171,10 +182,10 @@ describe(':Man', function() end) it('highlights various bullet formats', function() - feed([[ + feed(dedent([[ i· ·· +o - ++oo double]]) + ++oo double]])) exec_lua [[require'man'.init_pager()]] screen:expect([[ @@ -187,11 +198,11 @@ describe(':Man', function() end) it('handles : characters in input', function() - feed([[ + feed(dedent([[ i[40m 0 [41m 1 [42m 2 [43m 3 [44m 4 [45m 5 [46m 6 [47m 7 [100m 8 [101m 9 [102m 10 [103m 11 [104m 12 [105m 13 [106m 14 [107m 15 - [48:5:16m 16 ]]) + [48:5:16m 16 ]])) exec_lua [[require'man'.init_pager()]] screen:expect([[ diff --git a/test/functional/testnvim.lua b/test/functional/testnvim.lua index c0375b083a..ff5f9ff2e8 100644 --- a/test/functional/testnvim.lua +++ b/test/functional/testnvim.lua @@ -366,7 +366,7 @@ end --- @param ... string function M.feed(...) for _, v in ipairs({ ... }) do - nvim_feed(dedent(v)) + nvim_feed(v) end end @@ -615,7 +615,7 @@ function M.insert(...) nvim_feed('i') for _, v in ipairs({ ... }) do local escaped = v:gsub('<', '') - M.feed(escaped) -- This also dedents :P + nvim_feed(dedent(escaped)) end nvim_feed('') end