From 786594b23be4a757e95776f782527c8a98fbaab5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 4 May 2019 07:06:30 +0200 Subject: 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) --- test/Tests/Lua.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') 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 -- cgit v1.2.3