diff options
author | David Lukes <dafydd.lukes@gmail.com> | 2020-06-12 02:34:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 20:34:34 -0400 |
commit | 6d1404faf0e4515e409044aff195656d5e6830a1 (patch) | |
tree | c31f6f64b5a9382ee55e5dd5e63adf28045d9093 | |
parent | b751d16cadfc3d2c7e7958432956859b3e2482fa (diff) | |
download | rneovim-6d1404faf0e4515e409044aff195656d5e6830a1.tar.gz rneovim-6d1404faf0e4515e409044aff195656d5e6830a1.tar.bz2 rneovim-6d1404faf0e4515e409044aff195656d5e6830a1.zip |
test: Fix ignored LSP tests (#12470)
* Fix ignored LSP tests
* Restructure _make_floating_popup_size tests
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index ae436360c3..5a8a9106a5 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -1232,7 +1232,7 @@ describe('LSP', function() ]]) end) end) - describe('convert SymbolInformation[] to items', function() + it('convert SymbolInformation[] to items', function() local expected = { { col = 1, @@ -1296,11 +1296,11 @@ describe('LSP', function() end) describe('lsp.util._get_completion_item_kind_name', function() - describe('returns the name specified by protocol', function() + it('returns the name specified by protocol', function() eq("Text", exec_lua("return vim.lsp.util._get_completion_item_kind_name(1)")) eq("TypeParameter", exec_lua("return vim.lsp.util._get_completion_item_kind_name(25)")) end) - describe('returns the name not specified by protocol', function() + it('returns the name not specified by protocol', function() eq("Unknown", exec_lua("return vim.lsp.util._get_completion_item_kind_name(nil)")) eq("Unknown", exec_lua("return vim.lsp.util._get_completion_item_kind_name(vim.NIL)")) eq("Unknown", exec_lua("return vim.lsp.util._get_completion_item_kind_name(1000)")) @@ -1308,11 +1308,11 @@ describe('LSP', function() end) describe('lsp.util._get_symbol_kind_name', function() - describe('returns the name specified by protocol', function() + it('returns the name specified by protocol', function() eq("File", exec_lua("return vim.lsp.util._get_symbol_kind_name(1)")) eq("TypeParameter", exec_lua("return vim.lsp.util._get_symbol_kind_name(26)")) end) - describe('returns the name not specified by protocol', function() + it('returns the name not specified by protocol', function() eq("Unknown", exec_lua("return vim.lsp.util._get_symbol_kind_name(nil)")) eq("Unknown", exec_lua("return vim.lsp.util._get_symbol_kind_name(vim.NIL)")) eq("Unknown", exec_lua("return vim.lsp.util._get_symbol_kind_name(1000)")) @@ -1381,12 +1381,20 @@ describe('LSP', function() end) describe('lsp.util._make_floating_popup_size', function() - exec_lua [[ contents = - {"text tαxt txtα tex", - "text tααt tααt text", - "text tαxt tαxt"} - ]] - eq({19,3}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents)} ]]) - eq({15,5}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents,{width = 15, wrap_at = 14})} ]]) + before_each(function() + exec_lua [[ contents = + {"text tαxt txtα tex", + "text tααt tααt text", + "text tαxt tαxt"} + ]] + end) + + it('calculates size correctly', function() + eq({19,3}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents)} ]]) + end) + + it('calculates size correctly with wrapping', function() + eq({15,5}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents,{width = 15, wrap_at = 14})} ]]) + end) end) end) |