diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-25 02:17:15 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-04-26 03:41:24 +0200 |
commit | 00843902d3472ac4e74106fc06fa60e599914496 (patch) | |
tree | 6d227b71062232086a218af7086d2b31552dc69c /test/functional/ui/screen_basic_spec.lua | |
parent | 88023d51238698dd625c26300142d3dbe5770b73 (diff) | |
download | rneovim-00843902d3472ac4e74106fc06fa60e599914496.tar.gz rneovim-00843902d3472ac4e74106fc06fa60e599914496.tar.bz2 rneovim-00843902d3472ac4e74106fc06fa60e599914496.zip |
api/ui: externalize tabline
- Work with a bool[] array parallel to the UIWidget enum.
- Rename some functions.
- Documentation.
Diffstat (limited to 'test/functional/ui/screen_basic_spec.lua')
-rw-r--r-- | test/functional/ui/screen_basic_spec.lua | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index d9cb3d7b6f..d6aa1aa993 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -6,7 +6,7 @@ local insert = helpers.insert local eq = helpers.eq local eval = helpers.eval -describe('Initial screen', function() +describe('screen', function() local screen local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler', @@ -27,7 +27,7 @@ describe('Initial screen', function() screen:detach() end) - it('is the default initial screen', function() + it('default initial screen', function() screen:expect([[ ^ | {0:~ }| @@ -565,12 +565,40 @@ describe('Screen', function() ]]) end) end) +end) - it('nvim_ui_attach() handles very large width/height #2180', function() - screen:detach() - screen = Screen.new(999, 999) +describe('nvim_ui_attach()', function() + before_each(function() + clear() + end) + it('handles very large width/height #2180', function() + local screen = Screen.new(999, 999) screen:attach() eq(999, eval('&lines')) eq(999, eval('&columns')) end) + it('"ui_ext" widgets', function() + local screen = Screen.new() + screen:attach({ui_ext={ + 'cmdline', + 'popupmenu', + 'tabline', + 'wildmenu', + }}) + end) + it('invalid "ui_ext" returns error', function() + local screen = Screen.new() + + local status, rv = pcall(function() screen:attach({ui_ext={'foo'}}) end) + eq(false, status) + eq('ui_ext: unknown widget: foo', rv:match("ui_ext:.*")) + + status, rv = pcall(function() screen:attach({ui_ext={'cmdline','foo'}}) end) + eq(false, status) + eq('ui_ext: unknown widget: foo', rv:match("ui_ext:.*")) + + status, rv = pcall(function() screen:attach({ui_ext={'cmdline',1}}) end) + eq(false, status) + eq('ui_ext: item must be a String', rv:match("ui_ext:.*")) + end) end) |