diff options
author | Maria José Solano <majosolano99@gmail.com> | 2023-09-19 21:30:22 -0700 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-09-20 07:00:52 +0100 |
commit | b2265bb72c268c95180dc92c129be11fd87f995d (patch) | |
tree | e8d6b6f1cc99218fab849e7ea5d6b4b46c03c13a /test/functional/plugin/lsp/utils_spec.lua | |
parent | c4f4c7a356013c6f1e10b7bf239d9e3c4c0c336e (diff) | |
download | rneovim-b2265bb72c268c95180dc92c129be11fd87f995d.tar.gz rneovim-b2265bb72c268c95180dc92c129be11fd87f995d.tar.bz2 rneovim-b2265bb72c268c95180dc92c129be11fd87f995d.zip |
test(lsp): add normalize_markdown tests
Diffstat (limited to 'test/functional/plugin/lsp/utils_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/utils_spec.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp/utils_spec.lua b/test/functional/plugin/lsp/utils_spec.lua index f544255d81..12763cfef5 100644 --- a/test/functional/plugin/lsp/utils_spec.lua +++ b/test/functional/plugin/lsp/utils_spec.lua @@ -88,6 +88,40 @@ describe('vim.lsp.util', function() end) end) + describe('normalize_markdown', function () + it('collapses consecutive blank lines', function () + local result = exec_lua [[ + local lines = { + 'foo', + '', + '', + '', + 'bar', + '', + 'baz' + } + return vim.lsp.util._normalize_markdown(lines) + ]] + local expected = {'foo', '', 'bar', '', 'baz'} + eq(expected, result) + end) + + it('removes preceding and trailing empty lines', function () + local result = exec_lua [[ + local lines = { + '', + 'foo', + 'bar', + '', + '' + } + return vim.lsp.util._normalize_markdown(lines) + ]] + local expected = {'foo', 'bar'} + eq(expected, result) + end) + end) + describe("make_floating_popup_options", function () local function assert_anchor(anchor_bias, expected_anchor) |