diff options
Diffstat (limited to 'test/functional/api/tabpage_spec.lua')
-rw-r--r-- | test/functional/api/tabpage_spec.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/functional/api/tabpage_spec.lua b/test/functional/api/tabpage_spec.lua index 47dede8b44..e10f30085f 100644 --- a/test/functional/api/tabpage_spec.lua +++ b/test/functional/api/tabpage_spec.lua @@ -1,4 +1,3 @@ --- Sanity checks for tabpage_* API calls via msgpack-rpc local helpers = require('test.functional.helpers')(after_each) local clear, nvim, tabpage, curtab, eq, ok = helpers.clear, helpers.nvim, helpers.tabpage, helpers.curtab, helpers.eq, @@ -8,7 +7,7 @@ local funcs = helpers.funcs local request = helpers.request local NIL = helpers.NIL -describe('tabpage_* functions', function() +describe('api/tabpage', function() before_each(clear) describe('list_wins and get_win', function() @@ -51,6 +50,22 @@ describe('tabpage_* functions', function() end) end) + describe('get_number', function() + it('works', function() + local tabs = nvim('list_tabpages') + eq(1, tabpage('get_number', tabs[1])) + + nvim('command', 'tabnew') + local tab1, tab2 = unpack(nvim('list_tabpages')) + eq(1, tabpage('get_number', tab1)) + eq(2, tabpage('get_number', tab2)) + + nvim('command', '-tabmove') + eq(2, tabpage('get_number', tab1)) + eq(1, tabpage('get_number', tab2)) + end) + end) + describe('is_valid', function() it('works', function() nvim('command', 'tabnew') |