aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2019-05-20 18:52:28 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2019-05-20 12:52:28 -0400
commit6208d4e7fcf1792203b3069d0002ad5cb1ec05dd (patch)
tree4aa85637c54ffaf67b950c1ed3c9ff7ce9a940de /test/Tests/Lua
parent90141e7b4fc48477106ee5481e3d9b1b4a54338e (diff)
downloadpandoc-6208d4e7fcf1792203b3069d0002ad5cb1ec05dd.tar.gz
Improve output of Lua tests (#5499)
This makes use of tasty-lua, a package to write tests in Lua and integrate the results into Tasty output. Test output becomes more informative: individual tests and test groups become visible in test output. Failures are reported with helpful error messages.
Diffstat (limited to 'test/Tests/Lua')
-rw-r--r--test/Tests/Lua/Module.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Tests/Lua/Module.hs b/test/Tests/Lua/Module.hs
new file mode 100644
index 000000000..82c9330e5
--- /dev/null
+++ b/test/Tests/Lua/Module.hs
@@ -0,0 +1,27 @@
+{- |
+Module : Tests.Lua.Module
+Copyright : © 2019 Albert Krewinkel
+License : GNU GPL, version 2 or above
+
+Maintainer : Albert Krewinkel <albert@zeitkraut.de>
+Stability : alpha
+Portability : portable
+
+Lua module tests
+-}
+module Tests.Lua.Module (tests) where
+
+import System.FilePath ((</>))
+import Test.Tasty (TestName, TestTree)
+import Test.Tasty.Lua (testLuaFile)
+
+import Tests.Lua (runLuaTest)
+
+tests :: [TestTree]
+tests =
+ [ testPandocLua "pandoc" ("lua" </> "module" </> "pandoc.lua")
+ , testPandocLua "pandoc.util" ("lua" </> "module" </> "pandoc.utils.lua")
+ ]
+
+testPandocLua :: TestName -> FilePath -> TestTree
+testPandocLua = testLuaFile runLuaTest