aboutsummaryrefslogtreecommitdiff
path: root/test/functional/script/text_utils_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/script/text_utils_spec.lua')
-rw-r--r--test/functional/script/text_utils_spec.lua39
1 files changed, 39 insertions, 0 deletions
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)