aboutsummaryrefslogtreecommitdiff
path: root/test/lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-11-02 16:49:50 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2021-11-02 16:49:50 +0100
commit210e4c98b0d09dd8e25c108dda14fdb17ba90192 (patch)
tree9c0fc244c6761a23f8c13406a8c3f3790151af84 /test/lua
parent3a0ac52f7b23b555a7eeb9e3df10536b809f95ac (diff)
downloadpandoc-210e4c98b0d09dd8e25c108dda14fdb17ba90192.tar.gz
Lua: allow to compare, show Citation values
Comparisons of Citation values are performed in Haskell; values are equal if they represent the same Haskell value. Converting a Citation value to a string now yields its native Haskell string representation.
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/module/pandoc.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua
index a0b888c74..4792e0949 100644
--- a/test/lua/module/pandoc.lua
+++ b/test/lua/module/pandoc.lua
@@ -481,6 +481,22 @@ return {
end)
},
group 'Other types' {
+ group 'Citation' {
+ test('checks equality by comparing Haskell values', function()
+ assert.are_equal(
+ pandoc.Citation('a', pandoc.NormalCitation),
+ pandoc.Citation('a', pandoc.NormalCitation)
+ )
+ assert.is_falsy(
+ pandoc.Citation('a', pandoc.NormalCitation) ==
+ pandoc.Citation('a', pandoc.AuthorInText)
+ )
+ assert.is_falsy(
+ pandoc.Citation('a', pandoc.NormalCitation) ==
+ pandoc.Citation('b', pandoc.NormalCitation)
+ )
+ end),
+ },
group 'SimpleTable' {
test('can access properties', function ()
local spc = pandoc.Space()