From 1f4c9da9c60f3cf5573c2f35e74c48a0f56056b4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 25 Sep 2019 01:56:29 -0400 Subject: test: fix screen assertions --- test/functional/ui/mouse_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/ui/mouse_spec.lua') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 3bd6b81ff1..440bae58e0 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -419,9 +419,9 @@ describe('ui/mouse/input', function() meths.set_option('showtabline', 2) screen:expect([[ {fill:test-test2 }| + testing | mouse | support and selectio^n | - {0:~ }| | ]]) meths.set_var('reply', {}) @@ -539,9 +539,9 @@ describe('ui/mouse/input', function() feed_command('tabprevious') -- go to first tab screen:expect([[ {sel: + foo }{tab: + bar }{fill: }{tab:X}| + testing | mouse | support and selectio^n | - {0:~ }| :tabprevious | ]]) feed('<10,0>') -- go to second tab -- cgit 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/ui/mouse_spec.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test/functional/ui/mouse_spec.lua') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 440bae58e0..fedef7da8a 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -26,6 +26,8 @@ describe('ui/mouse/input', function() }, [4] = {reverse = true}, [5] = {bold = true, reverse = true}, + [6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, + [7] = {bold = true, foreground = Screen.colors.SeaGreen4}, }) command("set display-=msgsep") feed('itestingmousesupport and selection') @@ -620,12 +622,12 @@ describe('ui/mouse/input', function() meths.set_option('tags', './non-existent-tags-file') feed('<0,0>') screen:expect([[ - E433: No tags file | - E426: tag not found: test| - ing | - Press ENTER or type comma| - nd to continue^ | - ]],nil,true) + {6:E433: No tags file} | + {6:E426: tag not found: test}| + {6:ing} | + {7:Press ENTER or type comma}| + {7:nd to continue}^ | + ]]) feed('') 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/ui/mouse_spec.lua | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test/functional/ui/mouse_spec.lua') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index fedef7da8a..7840ba9167 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -40,10 +40,6 @@ describe('ui/mouse/input', function() ]]) end) - after_each(function() - screen:detach() - end) - it('single left click moves cursor', function() feed('<2,1>') screen:expect([[ -- cgit From 49a40f425d88cbbac09fdf442c22f725bffc2249 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 24 Nov 2019 10:59:15 +0100 Subject: options: make 'fillchars' and 'listchars' global-local These options were previously global. A global-local window option behaves closer to a global option "per default" (i e with :set), but still supports local behavior via :setl Also this restores back-compat for nvim_set_option("fcs", ...) which are currently broken on 0.4.x but worked in earlier versions --- test/functional/ui/mouse_spec.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/functional/ui/mouse_spec.lua') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 7840ba9167..d857b57a31 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -12,7 +12,10 @@ describe('ui/mouse/input', function() clear() meths.set_option('mouse', 'a') meths.set_option('list', true) - meths.set_option('listchars', 'eol:$') + -- NB: this is weird, but mostly irrelevant to the test + -- So I didn't bother to change it + command('set listchars=eol:$') + command('setl listchars=nbsp:x') screen = Screen.new(25, 5) screen:attach() screen:set_default_attr_ids({ @@ -812,7 +815,8 @@ describe('ui/mouse/input', function() feed_command('set concealcursor=ni') feed_command('set nowrap') - feed_command('set shiftwidth=2 tabstop=4 list listchars=tab:>-') + feed_command('set shiftwidth=2 tabstop=4 list') + feed_command('setl listchars=tab:>-') feed_command('syntax match NonText "\\*" conceal') feed_command('syntax match NonText "cats" conceal cchar=X') feed_command('syntax match NonText "x" conceal cchar=>') -- cgit