diff options
Diffstat (limited to 'test/Tests')
-rw-r--r-- | test/Tests/Lua.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 058d5722b..0f6619240 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -2,6 +2,7 @@ module Tests.Lua ( tests ) where import Control.Monad (when) +import Data.Version (Version (versionBranch)) import System.FilePath ((</>)) import Test.Tasty (TestTree, localOption) import Test.Tasty.HUnit (Assertion, assertEqual, testCase) @@ -11,7 +12,7 @@ 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) +import Text.Pandoc.Definition (Block, Inline, Meta, Pandoc, pandocTypesVersion) import Text.Pandoc.Lua (runLuaFilter, runPandocLua) import Text.Pandoc.Shared (pandocVersion) @@ -115,6 +116,12 @@ tests = map (localOption (QuickCheckTests 20)) Lua.call 2 1 Lua.liftIO . assertEqual "pandoc version is wrong" pandocVersion =<< Lua.peek Lua.stackTop + + , testCase "Pandoc types version is set" . runPandocLua' $ do + let versionNums = versionBranch pandocTypesVersion + Lua.getglobal "PANDOC_API_VERSION" + Lua.liftIO . assertEqual "pandoc version is wrong" versionNums + =<< Lua.peek Lua.stackTop ] assertFilterConversion :: String -> FilePath -> Pandoc -> Pandoc -> Assertion |