mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test(lsp): add normalize_markdown tests
This commit is contained in:
parent
c4f4c7a356
commit
b2265bb72c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user