aboutsummaryrefslogtreecommitdiff
path: root/test/lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2019-06-11 19:39:42 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2019-06-11 19:48:00 +0200
commit7f9b32e36a8fdfe3efdcdb05b84cafd297641d85 (patch)
tree94b4184959b31db3c1ff50c4cb1829610ea68ef0 /test/lua
parent03b9f3d5f34633325141d48999a3222c6a34c796 (diff)
downloadpandoc-7f9b32e36a8fdfe3efdcdb05b84cafd297641d85.tar.gz
data/pandoc.lua: fix deletion of nonexistent attributes
Fixes: #5569
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/module/pandoc.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua
index 0bb4af9aa..1ecd1f609 100644
--- a/test/lua/module/pandoc.lua
+++ b/test/lua/module/pandoc.lua
@@ -62,6 +62,12 @@ return {
local assoc_list = setmetatable(attributes, nil)
assert.are_same(assoc_list, {{'b', '2'}})
end),
+ test('remains unchanged if deleted key did not exist', function ()
+ local assoc_list = pandoc.List:new {{'alpha', 'x'}, {'beta', 'y'}}
+ local attributes = pandoc.Attr('', {}, assoc_list:clone()).attributes
+ attributes.a = nil
+ assert.are_same(pandoc.List:new(attributes), assoc_list)
+ end),
test('gives key-value pairs when iterated-over', function ()
local attributes = {width = '11', height = '22', name = 'test'}
local attr = pandoc.Attr('', {}, attributes)