aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-12-20 09:28:38 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2021-12-20 09:41:03 +0100
commitcd2bffee1e4c0ca9c999bd37f81732664f9f107a (patch)
tree88822fe1d8ac78a476a8025cf5562ac24ae74c8d /test
parent993222d2c9c94cbf51f06528b79ffddd56b9da46 (diff)
downloadpandoc-cd2bffee1e4c0ca9c999bd37f81732664f9f107a.tar.gz
Lua: use more natural representation for Reference values
Omit `false` boolean values, push integers as numbers.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Lua/Module.hs2
-rw-r--r--test/lua/module/pandoc-utils.lua25
2 files changed, 26 insertions, 1 deletions
diff --git a/test/Tests/Lua/Module.hs b/test/Tests/Lua/Module.hs
index 8be445f65..e4d1e8bd9 100644
--- a/test/Tests/Lua/Module.hs
+++ b/test/Tests/Lua/Module.hs
@@ -29,7 +29,7 @@ tests =
("lua" </> "module" </> "pandoc-path.lua")
, testPandocLua "pandoc.types"
("lua" </> "module" </> "pandoc-types.lua")
- , testPandocLua "pandoc.util"
+ , testPandocLua "pandoc.utils"
("lua" </> "module" </> "pandoc-utils.lua")
]
diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua
index 0c3831bb1..7a43e9286 100644
--- a/test/lua/module/pandoc-utils.lua
+++ b/test/lua/module/pandoc-utils.lua
@@ -62,6 +62,31 @@ return {
end),
},
+ group 'references' {
+ test('gets references from doc', function ()
+ local ref = {
+ ['author'] = {
+ {given = 'Max', family = 'Mustermann'}
+ },
+ ['container-title'] = pandoc.Inlines('JOSS'),
+ ['id'] = 'test',
+ ['issued'] = {['date-parts'] = {{2021}}},
+ ['title'] = pandoc.Inlines{
+ pandoc.Quoted('DoubleQuote', 'Interesting'),
+ pandoc.Space(),
+ 'work'
+ },
+ ['type'] = 'article-journal',
+ }
+ local nocite = pandoc.Cite(
+ '@test',
+ {pandoc.Citation('test', 'NormalCitation')}
+ )
+ local doc = pandoc.Pandoc({}, {nocite = nocite, references = {ref}})
+ assert.are_same({ref}, pandoc.utils.references(doc))
+ end)
+ },
+
group 'sha1' {
test('hashing', function ()
local ref_hash = '0a0a9f2a6772942557ab5355d76af442f8f65e01'