summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Lua.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs
index 64c35b298..4196ff4b7 100644
--- a/test/Tests/Lua.hs
+++ b/test/Tests/Lua.hs
@@ -64,10 +64,14 @@ roundtripEqual x = (x ==) <$> roundtripped
roundtripped :: (Lua.StackValue a) => IO a
roundtripped = do
lua <- Lua.newstate
+ Lua.openlibs lua
+ pushPandocModule lua
+ Lua.setglobal lua "pandoc"
+ oldSize <- Lua.gettop lua
Lua.push lua x
size <- Lua.gettop lua
- when (size /= 1) $
- error ("not exactly one element on the stack: " ++ show size)
+ when ((size - oldSize) /= 1) $
+ error ("not exactly one additional element on the stack: " ++ show size)
res <- Lua.peek lua (-1)
retval <- case res of
Nothing -> error "could not read from stack"