aboutsummaryrefslogtreecommitdiff
path: root/test/lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-11-02 17:38:49 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2021-11-02 17:40:07 +0100
commitcce49c5d4b7429ca3455d356dff59f404f7e6d4b (patch)
tree897b2d7847f3243ed0ce03511a16ef079b5c7748 /test/lua
parent70eeeca9c7b399158f01c40ab2f6ef58bd76207f (diff)
downloadpandoc-cce49c5d4b7429ca3455d356dff59f404f7e6d4b.tar.gz
Lua: be more forgiving when retrieving the Image `caption` property
Fixes a regression introduced in 2.15.
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/module/pandoc.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua
index 9f5f5c771..be1cbbde1 100644
--- a/test/lua/module/pandoc.lua
+++ b/test/lua/module/pandoc.lua
@@ -191,6 +191,15 @@ return {
assert.are_equal(pandoc.Code('1 + 1'), code)
end),
},
+ group 'Image' {
+ test('has property `caption`', function ()
+ local img = pandoc.Image('example', 'a.png')
+ assert.are_same(img.caption, {pandoc.Str 'example'})
+
+ img.caption = {pandoc.Str 'A'}
+ assert.are_equal(img, pandoc.Image({pandoc.Str 'A'}, 'a.png'))
+ end),
+ },
group 'Link' {
test('has property `content`', function ()
local link = pandoc.Link('example', 'https://example.org')