aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2019-05-04 07:06:30 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2019-05-04 01:06:30 -0400
commit786594b23be4a757e95776f782527c8a98fbaab5 (patch)
tree6cf961b47a7d9df096be0347497a56c26b160aa8 /test
parent4f260c96d9b84fb90d4e9b7c611556b1708b90fe (diff)
downloadpandoc-786594b23be4a757e95776f782527c8a98fbaab5.tar.gz
Lua: add `pandoc.system` module (#5468)
The `system` Lua module provides utility functions to interact with the operating- and file system. E.g. print(pandoc.system.get_current_directory()) or pandoc.system.with_temporary_directory('tikz', function (dir) -- write and compile a TikZ file with pdflatex end)
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Lua.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs
index a66952de8..4040c38ac 100644
--- a/test/Tests/Lua.hs
+++ b/test/Tests/Lua.hs
@@ -185,6 +185,11 @@ tests = map (localOption (QuickCheckTests 20))
Lua.liftIO . assertEqual "no accessor" (("hi", ["moin"], []) :: Attr)
=<< Lua.peek Lua.stackTop
+ , testCase "module `pandoc.system` is present" . runLua' $ do
+ Lua.getglobal' "pandoc.system"
+ ty <- Lua.ltype Lua.stackTop
+ Lua.liftIO $ assertEqual "module should be a table" Lua.TypeTable ty
+
, testCase "informative error messages" . runLua' $ do
Lua.pushboolean True
err <- Lua.peekEither Lua.stackTop