From a7aeda8c7a3b2c9854d40c1c9278fd67d94aaf3d Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 5 Mar 2015 10:07:55 +0100 Subject: tests/ui: Also test character at cursor --- test/functional/ui/highlight_spec.lua | 16 ++++++------ test/functional/ui/mouse_spec.lua | 34 +++++++++++++------------- test/functional/ui/screen.lua | 3 +-- test/functional/ui/screen_basic_spec.lua | 42 ++++++++++++++++---------------- test/functional/ui/sign_spec.lua | 2 +- test/functional/ui/wildmode_spec.lua | 2 +- 6 files changed, 49 insertions(+), 50 deletions(-) (limited to 'test/functional/ui') diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 52ab3cb5bf..33a53ef201 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -54,7 +54,7 @@ describe('Default highlight groups', function() }) execute('sp', 'vsp', 'vsp') screen:expect([[ - ^ {2:|} {2:|} | + ^ {2:|} {2:|} | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | @@ -79,7 +79,7 @@ describe('Default highlight groups', function() ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | {2:[No Name] [No Name] [No Name] }| - ^ | + ^ | ~ | ~ | ~ | @@ -92,7 +92,7 @@ describe('Default highlight groups', function() -- (upstream vim has the same behavior) feed('kl') screen:expect([[ - {2:|}^ {2:|} | + {2:|}^ {2:|} | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | @@ -109,7 +109,7 @@ describe('Default highlight groups', function() ]]) feed('l') screen:expect([[ - {2:|} {2:|}^ | + {2:|} {2:|}^ | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | @@ -126,7 +126,7 @@ describe('Default highlight groups', function() ]]) feed('hh') screen:expect([[ - ^ {2:|} {2:|} | + ^ {2:|} {2:|} | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | ~ {2:|}~ {2:|}~ | @@ -146,7 +146,7 @@ describe('Default highlight groups', function() it('insert mode text', function() feed('i') screen:expect([[ - ^ | + ^ | ~ | ~ | ~ | @@ -165,7 +165,7 @@ describe('Default highlight groups', function() it('end of file markers', function() screen:expect([[ - ^ | + ^ | {1:~ }| {1:~ }| {1:~ }| @@ -198,7 +198,7 @@ describe('Default highlight groups', function() ~ | :ls | 1 %a "[No Name]" line 1 | - {1:Press ENTER or type command to continue}^ | + {1:Press ENTER or type command to continue}^ | ]], {[1] = {bold = true, foreground = hlgroup_colors.Question}}) feed('') -- skip the "Press ENTER..." state or tests will hang end) diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 296487fc9c..f1973f60ba 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -28,7 +28,7 @@ describe('Mouse input', function() screen:expect([[ testing | mouse | - support and selectio^ | + support and selectio^n | ~ | | ]]) @@ -42,14 +42,14 @@ describe('Mouse input', function() feed('<2,1>') screen:expect([[ testing | - mo^se | + mo^use | support and selection | ~ | | ]]) feed('<0,0>') screen:expect([[ - ^esting | + ^testing | mouse | support and selection | ~ | @@ -62,7 +62,7 @@ describe('Mouse input', function() feed('<2,1>') screen:expect([[ testing | - mo^se | + mo^use | support and selection | ~ | | @@ -70,7 +70,7 @@ describe('Mouse input', function() feed('<4,1>') screen:expect([[ testing | - mo{1:us}^ | + mo{1:us}^e | support and selection | ~ | {2:-- VISUAL --} | @@ -79,13 +79,13 @@ describe('Mouse input', function() screen:expect([[ testing | mo{1:use } | - {1:su}^port and selection | + {1:su}^pport and selection | ~ | {2:-- VISUAL --} | ]]) feed('<0,0>') screen:expect([[ - ^{1:esting } | + ^t{1:esting } | {1:mou}se | support and selection | ~ | @@ -98,7 +98,7 @@ describe('Mouse input', function() screen:expect([[ testing | mouse | - {1:suppor}^ and selection | + {1:suppor}^t and selection | ~ | {2:-- VISUAL --} | ]]) @@ -109,7 +109,7 @@ describe('Mouse input', function() screen:expect([[ testing | mouse | - {1:su}^{1:port and selection } | + {1:su}^p{1:port and selection } | ~ | {2:-- VISUAL LINE --} | ]]) @@ -120,7 +120,7 @@ describe('Mouse input', function() screen:expect([[ testing | mouse | - su^port and selection | + su^pport and selection | ~ | {2:-- VISUAL BLOCK --} | ]]) @@ -129,7 +129,7 @@ describe('Mouse input', function() it('right click extends visual selection to the clicked location', function() feed('<0,0>') screen:expect([[ - ^esting | + ^testing | mouse | support and selection | ~ | @@ -139,7 +139,7 @@ describe('Mouse input', function() screen:expect([[ {1:testing } | {1:mouse } | - {1:su}^port and selection | + {1:su}^pport and selection | ~ | {2:-- VISUAL --} | ]]) @@ -153,7 +153,7 @@ describe('Mouse input', function() E426: tag not found: test| ing | Press ENTER or type comma| - nd to continue^ | + nd to continue^ | ]],nil,true) feed('') end) @@ -179,7 +179,7 @@ describe('Mouse input', function() to |to | test |test | mouse scrolling |mouse scrolling | - ^ | | + ^ | | ~ |~ | [No Name] [+] [No Name] [+] | to | @@ -193,7 +193,7 @@ describe('Mouse input', function() feed('<0,0>') screen:expect([[ mouse scrolling |lines | - ^ |to | + ^ |to | ~ |test | ~ |mouse scrolling | ~ | | @@ -210,7 +210,7 @@ describe('Mouse input', function() feed('<27,0>') screen:expect([[ mouse scrolling |text | - ^ |with | + ^ |with | ~ |many | ~ |lines | ~ |to | @@ -227,7 +227,7 @@ describe('Mouse input', function() feed('<27,7>') screen:expect([[ mouse scrolling |text | - ^ |with | + ^ |with | ~ |many | ~ |lines | ~ |to | diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 71703cc112..585037466e 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -418,9 +418,8 @@ function Screen:_row_repr(row, attr_ids, attr_ignore) end if self._rows[self._cursor.row] == row and self._cursor.col == i then table.insert(rv, '^') - else - table.insert(rv, row[i].text) end + table.insert(rv, row[i].text) end if current_attr_id then table.insert(rv, '}') diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 06edf44a7c..366a0af453 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -85,7 +85,7 @@ describe('Screen', function() it('horizontal', function() execute('sp') screen:expect([[ - ^ | + ^ | ~ | ~ | ~ | @@ -106,7 +106,7 @@ describe('Screen', function() execute('sp') execute('resize 8') screen:expect([[ - ^ | + ^ | ~ | ~ | ~ | @@ -126,7 +126,7 @@ describe('Screen', function() it('horizontal and vertical', function() execute('sp', 'vsp', 'vsp') screen:expect([[ - ^ | | | + ^ | | | ~ |~ |~ | ~ |~ |~ | ~ |~ |~ | @@ -143,7 +143,7 @@ describe('Screen', function() ]]) insert('hello') screen:expect([[ - hell^ |hello |hello | + hell^o |hello |hello | ~ |~ |~ | ~ |~ |~ | ~ |~ |~ | @@ -169,7 +169,7 @@ describe('Screen', function() execute('sp', 'vsp', 'vsp') insert('hello') screen:expect([[ - hell^ |hello |hello | + hell^o |hello |hello | ~ |~ |~ | ~ |~ |~ | ~ |~ |~ | @@ -189,7 +189,7 @@ describe('Screen', function() feed('h') screen:expect([[ 4+ [No Name] + [No Name] X| - hell^2 | + hell^o2 | ~ | ~ | ~ | @@ -206,7 +206,7 @@ describe('Screen', function() execute('tabprevious') screen:expect([[ 4+ [No Name] + [No Name] X| - hell^ |hello |hello | + hell^o |hello |hello | ~ |~ |~ | ~ |~ |~ | ~ |~ |~ | @@ -229,7 +229,7 @@ describe('Screen', function() screen:expect([[ line 1 | line 2 | - ^ | + ^ | ~ | ~ | ~ | @@ -262,7 +262,7 @@ describe('Screen', function() ~ | ~ | ~ | - :ls^ | + :ls^ | ]]) end) @@ -282,7 +282,7 @@ describe('Screen', function() ~ | :ls | 1 %a "[No Name]" line 1 | - Press ENTER or type command to continue^ | + Press ENTER or type command to continue^ | ]]) feed('') -- skip the "Press ENTER..." state or tests will hang end) @@ -312,7 +312,7 @@ describe('Screen', function() in |in |in | split |split |split | windows |windows |windows | - ^ | | | + ^ | | | [No Name] [+] [No Name] [+] [No Name] [+] | clearing | in | @@ -327,7 +327,7 @@ describe('Screen', function() it('only affects the current scroll region', function() feed('6k') screen:expect([[ - ^crolling |and |and | + ^scrolling |and |and | and |clearing |clearing | clearing |in |in | in |split |split | @@ -349,7 +349,7 @@ describe('Screen', function() clearing |in |in | in |split |split | split |windows |windows | - windows |^ | | + windows |^ | | [No Name] [+] [No Name] [+] :ls') screen:expect([[ resize | - :ls^ | + :ls^ | ]]) end) end) diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index a7a4172440..c32a7b9381 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -28,7 +28,7 @@ describe('Signs', function() >!a | b | >>c | - ^ | + ^ | ~ | ~ | ~ | diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index ee2f8b15f8..dd2bc84cfa 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -25,7 +25,7 @@ describe("'wildmode'", function() ~ | ~ | define jump list > | - :sign define^ | + :sign define^ | ]]) end) end) -- cgit