From a330129a280a34963e42d498f7cb1f53e6723e85 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 12 Oct 2019 13:29:51 +0200 Subject: tests/ui: cleanup illegitimate usages of "attr_ignore" "attr_ignore" is an anti-pattern, with snapshot_util() just include all the highlights already. --- test/functional/plugin/man_spec.lua | 50 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'test/functional/plugin/man_spec.lua') diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua index d95995797e..e06e4b874e 100644 --- a/test/functional/plugin/man_spec.lua +++ b/test/functional/plugin/man_spec.lua @@ -19,10 +19,8 @@ describe(':Man', function() u = { underline = true }, bi = { bold = true, italic = true }, biu = { bold = true, italic = true, underline = true }, - }) - screen:set_default_attr_ignore({ - { foreground = Screen.colors.Blue }, -- control chars - { bold = true, foreground = Screen.colors.Blue } -- empty line '~'s + c = { foreground = Screen.colors.Blue }, -- control chars + eob = { bold = true, foreground = Screen.colors.Blue } -- empty line '~'s }) screen:attach() end) @@ -36,21 +34,21 @@ describe(':Man', function() ithis iiss aa test with _o_v_e_r_s_t_r_u_c_k text]]) - screen:expect([[ - this i^His^Hs a^Ha test | - with _^Ho_^Hv_^He_^Hr_^Hs_^Ht_^Hr_^Hu_^Hc_^Hk tex^t | - ~ | - ~ | - | - ]]) + screen:expect{grid=[[ + this i{c:^H}is{c:^H}s a{c:^H}a test | + with _{c:^H}o_{c:^H}v_{c:^H}e_{c:^H}r_{c:^H}s_{c:^H}t_{c:^H}r_{c:^H}u_{c:^H}c_{c:^H}k tex^t | + {eob:~ }| + {eob:~ }| + | + ]]} eval('man#init_pager()') screen:expect([[ ^this {b:is} {b:a} test | with {u:overstruck} text | - ~ | - ~ | + {eob:~ }| + {eob:~ }| | ]]) end) @@ -60,21 +58,21 @@ describe(':Man', function() ithis [1mis [3ma [4mtest[0m [4mwith[24m [4mescaped[24m [4mtext[24m]]) - screen:expect([=[ - this ^[[1mis ^[[3ma ^[[4mtest^[[0m | - ^[[4mwith^[[24m ^[[4mescaped^[[24m ^[[4mtext^[[24^m | - ~ | - ~ | - | - ]=]) + screen:expect{grid=[=[ + this {c:^[}[1mis {c:^[}[3ma {c:^[}[4mtest{c:^[}[0m | + {c:^[}[4mwith{c:^[}[24m {c:^[}[4mescaped{c:^[}[24m {c:^[}[4mtext{c:^[}[24^m | + {eob:~ }| + {eob:~ }| + | + ]=]} eval('man#init_pager()') screen:expect([[ ^this {b:is }{bi:a }{biu:test} | {u:with} {u:escaped} {u:text} | - ~ | - ~ | + {eob:~ }| + {eob:~ }| | ]]) end) @@ -88,8 +86,8 @@ describe(':Man', function() screen:expect([[ ^this {b:is} {b:あ} test | with {u:överstrũck} te{i:xt¶} | - ~ | - ~ | + {eob:~ }| + {eob:~ }| | ]]) end) @@ -105,7 +103,7 @@ describe(':Man', function() {b:^_begins} | {b:mid_dle} | {u:mid_dle} | - ~ | + {eob:~ }| | ]]) end) @@ -121,7 +119,7 @@ describe(':Man', function() ^· {b:·} | {b:·} | {b:·} double | - ~ | + {eob:~ }| | ]]) end) -- cgit From 4987311fb5b8f4a11d26995f71f5f402a9e2ace4 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 13 Oct 2019 20:18:22 +0200 Subject: tests/ui: remove unnecessary screen:detach() It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically. --- test/functional/plugin/man_spec.lua | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test/functional/plugin/man_spec.lua') diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua index e06e4b874e..e5b2e7dc1f 100644 --- a/test/functional/plugin/man_spec.lua +++ b/test/functional/plugin/man_spec.lua @@ -25,10 +25,6 @@ describe(':Man', function() screen:attach() end) - after_each(function() - screen:detach() - end) - it('clears backspaces from text and adds highlights', function() rawfeed([[ ithis iiss aa test -- cgit