diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-01-15 09:01:25 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-01-15 09:01:25 -0300 |
commit | dc18fa256f335f2e8c7762a4d04e2efbc61d47cc (patch) | |
tree | 1634fcd0ef15f0fe7794e4432f09621ee70ea61c /test/functional/ui/mouse_spec.lua | |
parent | c51c0950d3edef3309cf08979f5f9d434b8b73f0 (diff) | |
download | rneovim-dc18fa256f335f2e8c7762a4d04e2efbc61d47cc.tar.gz rneovim-dc18fa256f335f2e8c7762a4d04e2efbc61d47cc.tar.bz2 rneovim-dc18fa256f335f2e8c7762a4d04e2efbc61d47cc.zip |
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
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r-- | test/functional/ui/mouse_spec.lua | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 507b5aacae..653d8ad92c 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -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) |