diff options
author | Yan Pashkovsky <Yanpas@users.noreply.github.com> | 2018-05-09 19:48:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-09 19:48:34 +0300 |
commit | a337685fe0ab9c63b9456f27787bbe4f0d785a94 (patch) | |
tree | e9fc4dfc0802f8acd97f06a8cc8d7c89b5a988ab /test/Tests/Lua.hs | |
parent | 8e9973b9f761262b6871206f741ac3f2a25aa6bb (diff) | |
parent | 5f33d2e0cd9f19566904c93be04f586de811dd75 (diff) | |
download | pandoc-a337685fe0ab9c63b9456f27787bbe4f0d785a94.tar.gz |
Merge branch 'master' into groff_reader
Diffstat (limited to 'test/Tests/Lua.hs')
-rw-r--r-- | test/Tests/Lua.hs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index b25a6fa4a..28a691715 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -1,6 +1,8 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Tests.Lua ( tests ) where +import Prelude import Control.Monad (when) import Data.Version (Version (versionBranch)) import System.FilePath ((</>)) @@ -10,7 +12,8 @@ import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty) import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder (bulletList, divWith, doc, doubleQuoted, emph, header, linebreak, para, plain, rawBlock, - singleQuoted, space, str, strong, (<>)) + singleQuoted, space, str, strong, + math, displayMath) import Text.Pandoc.Class (runIOorExplode, setUserDataDir) import Text.Pandoc.Definition (Block (BlockQuote, Div, Para), Inline (Emph, Str), Attr, Meta, Pandoc, pandocTypesVersion) @@ -46,6 +49,12 @@ tests = map (localOption (QuickCheckTests 20)) (doc $ bulletList [plain (str "alfa"), plain (str "bravo")]) (doc $ bulletList [para (str "alfa"), para (str "bravo")]) + , testCase "convert display math to inline math" $ + assertFilterConversion "display math becomes inline math" + "math.lua" + (doc $ para (displayMath "5+5")) + (doc $ para (math "5+5")) + , testCase "make hello world document" $ assertFilterConversion "Document contains 'Hello, World!'" "hello-world-doc.lua" @@ -111,6 +120,12 @@ tests = map (localOption (QuickCheckTests 20)) , plain (str "to_roman_numeral: OK") ]) + , testCase "Script filename is set" $ + assertFilterConversion "unexpected script name" + "script-name.lua" + (doc $ para "ignored") + (doc $ para (str $ "lua" </> "script-name.lua")) + , testCase "Pandoc version is set" . runPandocLua' $ do Lua.getglobal' "table.concat" Lua.getglobal "PANDOC_VERSION" |