diff options
Diffstat (limited to 'test/Tests/Lua.hs')
-rw-r--r-- | test/Tests/Lua.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 9df5e79cd..c7652a200 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -12,7 +12,8 @@ import Text.Pandoc.Builder (bulletList, divWith, doc, doubleQuoted, emph, header, linebreak, para, plain, rawBlock, singleQuoted, space, str, strong, (<>)) import Text.Pandoc.Class (runIOorExplode, setUserDataDir) -import Text.Pandoc.Definition (Block, Inline, Meta, Pandoc, pandocTypesVersion) +import Text.Pandoc.Definition (Block, Inline (Emph, Str), Meta, Pandoc, + pandocTypesVersion) import Text.Pandoc.Lua (runLuaFilter, runPandocLua) import Text.Pandoc.Options (def) import Text.Pandoc.Shared (pandocVersion) @@ -124,6 +125,10 @@ tests = map (localOption (QuickCheckTests 20)) Lua.liftIO . assertEqual "pandoc-types version is wrong" versionNums =<< Lua.peek Lua.stackTop + , testCase "Allow singleton inline in constructors" . runPandocLua' $ do + res <- Lua.callFunc "pandoc.Emph" (Str "test") + Lua.liftIO $ assertEqual "Not the exptected Emph" (Emph [Str "test"]) res + , testCase "informative error messages" . runPandocLua' $ do Lua.pushboolean True err <- Lua.peekEither Lua.stackTop :: Lua.Lua (Either String Pandoc) |