From a25ce5762de712e67db5c3dc0f2537894d5a4420 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 14 Mar 2025 17:12:35 +0800 Subject: test: do not dedent() in feed() (#32884) Most callers of feed() do not expect feed() to dedent. Now use a literal space in tests where it looks better. --- test/functional/plugin/man_spec.lua | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'test/functional/plugin') 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([[ -- cgit