aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2018-09-24 20:11:00 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2018-09-24 20:11:27 +0200
commit56fe5b559e9dbda97840a45c9f3a0713e2913bb5 (patch)
treeb366cb73f09271508f99b55eb479b1bb5cb3c2f1 /test/Tests
parent0272e63527e0b06644e178c51508baf1cf96afa2 (diff)
downloadpandoc-56fe5b559e9dbda97840a45c9f3a0713e2913bb5.tar.gz
Use hslua v1.0.0
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Lua.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs
index 361b25297..3fe9c1121 100644
--- a/test/Tests/Lua.hs
+++ b/test/Tests/Lua.hs
@@ -164,11 +164,11 @@ tests = map (localOption (QuickCheckTests 20))
, testCase "informative error messages" . runPandocLua' $ do
Lua.pushboolean True
- err <- Lua.peekEither Lua.stackTop :: Lua.Lua (Either String Pandoc)
- case err of
+ err <- Lua.peekEither Lua.stackTop
+ case (err :: Either String Pandoc) of
Left msg -> do
let expectedMsg = "Could not get Pandoc value: "
- ++ "expected table but got boolean."
+ <> "table expected, got boolean"
Lua.liftIO $ assertEqual "unexpected error message" expectedMsg msg
Right _ -> error "Getting a Pandoc element from a bool should fail."
]
@@ -182,10 +182,10 @@ assertFilterConversion msg filterPath docIn docExpected = do
Left exception -> assertFailure (show exception)
Right docRes -> assertEqual msg docExpected docRes
-roundtripEqual :: (Eq a, Lua.FromLuaStack a, Lua.ToLuaStack a) => a -> IO Bool
+roundtripEqual :: (Eq a, Lua.Peekable a, Lua.Pushable a) => a -> IO Bool
roundtripEqual x = (x ==) <$> roundtripped
where
- roundtripped :: (Lua.FromLuaStack a, Lua.ToLuaStack a) => IO a
+ roundtripped :: (Lua.Peekable a, Lua.Pushable a) => IO a
roundtripped = runPandocLua' $ do
oldSize <- Lua.gettop
Lua.push x