aboutsummaryrefslogtreecommitdiff
path: root/test/lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2021-12-30 16:53:34 +0100
committerAlbert Krewinkel <[email protected]>2021-12-30 22:41:15 +0100
commit2dd1cde7158a032e58618c96543ce7db2fa1aa47 (patch)
tree933fe94fea987fb6ff9941c50e9406ed5df13b29 /test/lua
parentce7e1f516957c62124fcbcc83523786b0f36ed5d (diff)
Lua: allow binary (byte string) readers to be used with `pandoc.read`
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/module/pandoc.lua8
-rw-r--r--test/lua/module/tiny.epubbin0 -> 3097 bytes
2 files changed, 8 insertions, 0 deletions
diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua
index 892ffee03..397182438 100644
--- a/test/lua/module/pandoc.lua
+++ b/test/lua/module/pandoc.lua
@@ -279,6 +279,14 @@ return {
pandoc.read(indented_code, 'markdown', {indented_code_classes={'foo'}})
)
end),
+ test('can read epub', function ()
+ local epub = io.open('lua/module/tiny.epub', 'rb')
+ local blocks = pandoc.read(epub:read'a', 'epub').blocks
+ assert.are_equal(
+ blocks[#blocks],
+ pandoc.Para { pandoc.Emph 'EPUB' }
+ )
+ end),
test('failing read', function ()
assert.error_matches(
function () pandoc.read('foo', 'nosuchreader') end,
diff --git a/test/lua/module/tiny.epub b/test/lua/module/tiny.epub
new file mode 100644
index 000000000..9e92202b7
--- /dev/null
+++ b/test/lua/module/tiny.epub
Binary files differ