diff options
Diffstat (limited to 'test/lua/module')
-rw-r--r-- | test/lua/module/pandoc.lua | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 4da663f07..5a58914ef 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -809,7 +809,25 @@ return { ) assert.are_same(expected_table, new_table) end) - } + }, + group 'ReaderOptions' { + test('returns a userdata value', function () + local opts = pandoc.ReaderOptions {} + assert.are_equal(type(opts), 'userdata') + end), + test('can construct from table', function () + local opts = pandoc.ReaderOptions {columns = 66} + assert.are_equal(opts.columns, 66) + end), + test('can construct from other ReaderOptions value', function () + local orig = pandoc.ReaderOptions{columns = 65} + local copy = pandoc.ReaderOptions(orig) + for k, v in pairs(orig) do + assert.are_same(copy[k], v) + end + assert.are_equal(copy.columns, 65) + end), + }, }, group 'clone' { @@ -896,6 +914,16 @@ return { 'Extension empty_paragraphs not supported for gfm' ) end), + test('read with other indented code classes', function() + local indented_code = ' return true' + local expected = pandoc.Pandoc({ + pandoc.CodeBlock('return true', {class='foo'}) + }) + assert.are_same( + expected, + pandoc.read(indented_code, 'markdown', {indented_code_classes={'foo'}}) + ) + end), test('failing read', function () assert.error_matches( function () pandoc.read('foo', 'nosuchreader') end, |