aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/script/luacats_grammar_spec.lua (renamed from test/functional/luacats_grammar_spec.lua)4
-rw-r--r--test/functional/script/text_utils_spec.lua39
2 files changed, 41 insertions, 2 deletions
diff --git a/test/functional/luacats_grammar_spec.lua b/test/functional/script/luacats_grammar_spec.lua
index 5671848709..931fe42dd0 100644
--- a/test/functional/luacats_grammar_spec.lua
+++ b/test/functional/script/luacats_grammar_spec.lua
@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
-local grammar = require('src/nvim/generators/luacats_grammar')
+local grammar = require('scripts/luacats_grammar')
describe('luacats grammar', function()
--- @param text string
@@ -85,7 +85,7 @@ describe('luacats grammar', function()
test('@param level (integer|string) desc', {
kind = 'param',
name = 'level',
- type = '(integer|string)',
+ type = 'integer|string',
desc = 'desc',
})
diff --git a/test/functional/script/text_utils_spec.lua b/test/functional/script/text_utils_spec.lua
new file mode 100644
index 0000000000..c429d306d5
--- /dev/null
+++ b/test/functional/script/text_utils_spec.lua
@@ -0,0 +1,39 @@
+local helpers = require('test.functional.helpers')(after_each)
+local exec_lua = helpers.exec_lua
+local eq = helpers.eq
+
+local function md_to_vimdoc(text)
+ return exec_lua(
+ [[
+ local text_utils = require('scripts/text_utils')
+ return text_utils.md_to_vimdoc(table.concat(..., '\n'), 0, 0, 70)
+ ]],
+ text
+ )
+end
+
+local function test(act, exp)
+ eq(table.concat(exp, '\n'), md_to_vimdoc(act))
+end
+
+describe('md_to_vimdoc', function()
+ before_each(function()
+ helpers.clear()
+ end)
+
+ it('can render para after fenced code', function()
+ test({
+ '- Para1',
+ ' ```',
+ ' code',
+ ' ```',
+ ' Para2',
+ }, {
+ '• Para1 >',
+ ' code',
+ '<',
+ ' Para2',
+ '',
+ })
+ end)
+end)