test: Add more functional test to cover new code

- emulate gui_running and terminal colors
- scrolling/clearing regions
- mouse wheel scrolling
- setting icon/title
- :stop/:suspend
- screen resize
This commit is contained in:
Thiago de Arruda
2015-01-15 09:01:25 -03:00
parent c51c0950d3
commit dc18fa256f
4 changed files with 400 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
local clear, feed, nvim = helpers.clear, helpers.feed, helpers.nvim
local insert, execute = helpers.insert, helpers.execute
describe('Mouse input', function()
local screen, hlgroup_colors
@@ -154,4 +155,87 @@ describe('Mouse input', function()
]])
feed('<cr>')
end)
it('mouse whell will target the hovered window', function()
feed('ggdG')
insert([[
Inserting
text
with
many
lines
to
test
mouse scrolling
]])
screen:try_resize(53, 14)
execute('sp', 'vsp')
screen:expect([[
lines |lines |
to |to |
test |test |
mouse scrolling |mouse scrolling |
^ | |
~ |~ |
[No Name] [+] [No Name] [+] |
to |
test |
mouse scrolling |
|
~ |
[No Name] [+] |
:vsp |
]])
feed('<MouseUp><0,0>')
screen:expect([[
mouse scrolling |lines |
^ |to |
~ |test |
~ |mouse scrolling |
~ | |
~ |~ |
[No Name] [+] [No Name] [+] |
to |
test |
mouse scrolling |
|
~ |
[No Name] [+] |
|
]])
feed('<MouseDown><27,0>')
screen:expect([[
mouse scrolling |text |
^ |with |
~ |many |
~ |lines |
~ |to |
~ |test |
[No Name] [+] [No Name] [+] |
to |
test |
mouse scrolling |
|
~ |
[No Name] [+] |
|
]])
feed('<MouseDown><27,7><MouseDown>')
screen:expect([[
mouse scrolling |text |
^ |with |
~ |many |
~ |lines |
~ |to |
~ |test |
[No Name] [+] [No Name] [+] |
Inserting |
text |
with |
many |
lines |
[No Name] [+] |
|
]])
end)
end)