diff options
Diffstat (limited to 'test/Tests')
-rw-r--r-- | test/Tests/Lua.hs | 13 | ||||
-rw-r--r-- | test/Tests/Lua/Module.hs | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index c585182e4..7a1261eb2 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -15,7 +15,6 @@ module Tests.Lua ( runLuaTest, tests ) where import Prelude import Control.Monad (when) -import Data.Version (Version (versionBranch)) import System.FilePath ((</>)) import Test.Tasty (TestTree, localOption) import Test.Tasty.HUnit (Assertion, assertEqual, testCase) @@ -34,6 +33,7 @@ import Text.Pandoc.Options (def) import Text.Pandoc.Shared (pandocVersion) import qualified Foreign.Lua as Lua +import qualified Data.ByteString.Char8 as BS tests :: [TestTree] tests = map (localOption (QuickCheckTests 20)) @@ -135,17 +135,14 @@ tests = map (localOption (QuickCheckTests 20)) (doc $ para (str $ "lua" </> "script-name.lua")) , testCase "Pandoc version is set" . runLuaTest $ do - Lua.getglobal' "table.concat" Lua.getglobal "PANDOC_VERSION" - Lua.push ("." :: String) -- separator - Lua.call 2 1 - Lua.liftIO . assertEqual "pandoc version is wrong" pandocVersion - =<< Lua.peek Lua.stackTop + Lua.liftIO . + assertEqual "pandoc version is wrong" (BS.pack pandocVersion) + =<< Lua.tostring' Lua.stackTop , testCase "Pandoc types version is set" . runLuaTest $ do - let versionNums = versionBranch pandocTypesVersion Lua.getglobal "PANDOC_API_VERSION" - Lua.liftIO . assertEqual "pandoc-types version is wrong" versionNums + Lua.liftIO . assertEqual "pandoc-types version is wrong" pandocTypesVersion =<< Lua.peek Lua.stackTop , testCase "Allow singleton inline in constructors" . runLuaTest $ do diff --git a/test/Tests/Lua/Module.hs b/test/Tests/Lua/Module.hs index 82c9330e5..324acce04 100644 --- a/test/Tests/Lua/Module.hs +++ b/test/Tests/Lua/Module.hs @@ -20,7 +20,8 @@ import Tests.Lua (runLuaTest) tests :: [TestTree] tests = [ testPandocLua "pandoc" ("lua" </> "module" </> "pandoc.lua") - , testPandocLua "pandoc.util" ("lua" </> "module" </> "pandoc.utils.lua") + , testPandocLua "pandoc.types" ("lua" </> "module" </> "pandoc-types.lua") + , testPandocLua "pandoc.util" ("lua" </> "module" </> "pandoc-utils.lua") ] testPandocLua :: TestName -> FilePath -> TestTree |