aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Lua.hs3
-rw-r--r--test/lua/test-pandoc-utils.lua10
2 files changed, 11 insertions, 2 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs
index 956575911..7fb4309de 100644
--- a/test/Tests/Lua.hs
+++ b/test/Tests/Lua.hs
@@ -96,11 +96,12 @@ tests = map (localOption (QuickCheckTests 20))
assertFilterConversion "pandoc.utils doesn't work as expected."
"test-pandoc-utils.lua"
(doc $ para "doesn't matter")
- (doc $ mconcat [ plain (str "sha1: OK")
+ (doc $ mconcat [ plain (str "normalize_date: OK")
, plain (str "pipe: OK")
, plain (str "failing pipe: OK")
, plain (str "read: OK")
, plain (str "failing read: OK")
+ , plain (str "sha1: OK")
, plain (str "stringify: OK")
, plain (str "to_roman_numeral: OK")
])
diff --git a/test/lua/test-pandoc-utils.lua b/test/lua/test-pandoc-utils.lua
index 0a7aedbfd..b79f033f8 100644
--- a/test/lua/test-pandoc-utils.lua
+++ b/test/lua/test-pandoc-utils.lua
@@ -72,6 +72,13 @@ function test_to_roman_numeral ()
and not pcall(utils.to_roman_numeral, 'not a number')
end
+-- normalize_date
+------------------------------------------------------------------------
+function test_normalize_date ()
+ return utils.normalize_date("12/31/2017") == '2017-12-31'
+ and utils.normalize_date("pandoc") == nil
+end
+
-- Return result
------------------------------------------------------------------------
function run(fn)
@@ -80,11 +87,12 @@ end
function Para (el)
return {
- pandoc.Plain{pandoc.Str("sha1: " .. run(test_sha1))},
+ pandoc.Plain{pandoc.Str("normalize_date: " .. run(test_normalize_date))},
pandoc.Plain{pandoc.Str("pipe: " .. run(test_pipe))},
pandoc.Plain{pandoc.Str("failing pipe: " .. run(test_failing_pipe))},
pandoc.Plain{pandoc.Str("read: " .. run(test_read))},
pandoc.Plain{pandoc.Str("failing read: " .. run(test_failing_read))},
+ pandoc.Plain{pandoc.Str("sha1: " .. run(test_sha1))},
pandoc.Plain{pandoc.Str("stringify: " .. run(test_stringify))},
pandoc.Plain{pandoc.Str("to_roman_numeral: " .. run(test_to_roman_numeral))},
}