diff options
| author | Albert Krewinkel <[email protected]> | 2021-12-30 16:53:34 +0100 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2021-12-30 22:41:15 +0100 |
| commit | 2dd1cde7158a032e58618c96543ce7db2fa1aa47 (patch) | |
| tree | 933fe94fea987fb6ff9941c50e9406ed5df13b29 /test/lua/module | |
| parent | ce7e1f516957c62124fcbcc83523786b0f36ed5d (diff) | |
Lua: allow binary (byte string) readers to be used with `pandoc.read`
Diffstat (limited to 'test/lua/module')
| -rw-r--r-- | test/lua/module/pandoc.lua | 8 | ||||
| -rw-r--r-- | test/lua/module/tiny.epub | bin | 0 -> 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 Binary files differnew file mode 100644 index 000000000..9e92202b7 --- /dev/null +++ b/test/lua/module/tiny.epub |
