diff options
author | Dongdong Zhou <dzhou121@gmail.com> | 2017-02-24 09:35:27 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-04-26 02:15:31 +0200 |
commit | 88023d51238698dd625c26300142d3dbe5770b73 (patch) | |
tree | 3a3876cc8525a8ca7147bf273698886759d292be /test | |
parent | 7e571bca5d5e00e9e33e266b983a48bb4014183f (diff) | |
download | rneovim-88023d51238698dd625c26300142d3dbe5770b73.tar.gz rneovim-88023d51238698dd625c26300142d3dbe5770b73.tar.bz2 rneovim-88023d51238698dd625c26300142d3dbe5770b73.zip |
api/ui: externalize tabline
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/tabline_spec.lua | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua new file mode 100644 index 0000000000..018e008e4a --- /dev/null +++ b/test/functional/ui/tabline_spec.lua @@ -0,0 +1,58 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq + +if helpers.pending_win32(pending) then return end + +describe('External tab line', function() + local screen + local tabs, curtab + + before_each(function() + clear() + screen = Screen.new(25, 5) + screen:attach({rgb=true, tabline_external=true}) + screen:set_on_event_handler(function(name, data) + if name == "tabline_update" then + curtab, tabs = unpack(data) + end + end) + end) + + after_each(function() + screen:detach() + end) + + describe("'tabline'", function() + it('tabline', function() + local expected = { + {1, {['name'] = '[No Name]'}}, + {2, {['name'] = '[No Name]'}}, + } + feed(":tabnew<CR>") + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + | + ]], nil, nil, function() + eq(2, curtab) + eq(expected, tabs) + end) + + feed(":tabNext<CR>") + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + | + ]], nil, nil, function() + eq(1, curtab) + eq(expected, tabs) + end) + + end) + end) +end) |