diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Command.hs | 6 | ||||
-rw-r--r-- | test/Tests/Lua.hs | 16 | ||||
-rw-r--r-- | test/Tests/Readers/Docx.hs | 8 | ||||
-rw-r--r-- | test/Tests/Readers/HTML.hs | 2 | ||||
-rw-r--r-- | test/Tests/Readers/LaTeX.hs | 4 | ||||
-rw-r--r-- | test/Tests/Readers/Odt.hs | 6 | ||||
-rw-r--r-- | test/Tests/Shared.hs | 2 | ||||
-rw-r--r-- | test/Tests/Writers/Docx.hs | 10 | ||||
-rw-r--r-- | test/Tests/Writers/Muse.hs | 2 | ||||
-rw-r--r-- | test/test-pandoc.hs | 6 |
10 files changed, 31 insertions, 31 deletions
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs index 608b00b18..4999ff45a 100644 --- a/test/Tests/Command.hs +++ b/test/Tests/Command.hs @@ -2,20 +2,20 @@ module Tests.Command (findPandoc, runTest, tests) where import Data.Algorithm.Diff +import qualified Data.ByteString as BS import Data.List (isSuffixOf) import Prelude hiding (readFile) import System.Directory import System.Exit import System.FilePath (joinPath, splitDirectories, takeDirectory, (</>)) +import System.IO (hPutStr, stderr) +import System.IO.Unsafe (unsafePerformIO) import System.Process -import System.IO (stderr, hPutStr) import Test.Tasty import Test.Tasty.HUnit import Tests.Helpers import Text.Pandoc -import qualified Data.ByteString as BS import qualified Text.Pandoc.UTF8 as UTF8 -import System.IO.Unsafe (unsafePerformIO) -- TODO temporary -- | Run a test with normalize function, return True if test passed. runTest :: String -- ^ Title of test diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index ba6196ccb..f9f0e9753 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -1,15 +1,15 @@ -{-# Language OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} module Tests.Lua ( tests ) where import Control.Monad (when) import System.FilePath ((</>)) import Test.Tasty (TestTree, localOption) import Test.Tasty.HUnit (Assertion, assertEqual, testCase) -import Test.Tasty.QuickCheck (ioProperty, testProperty, QuickCheckTests(..)) +import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty) import Text.Pandoc.Arbitrary () -import Text.Pandoc.Builder ( (<>), bulletList, doc, doubleQuoted, emph - , linebreak, rawBlock, singleQuoted, para, plain - , space, str, strong) +import Text.Pandoc.Builder (bulletList, doc, doubleQuoted, emph, linebreak, + para, plain, rawBlock, singleQuoted, space, str, + strong, (<>)) import Text.Pandoc.Class (runIOorExplode) import Text.Pandoc.Definition (Block, Inline, Meta, Pandoc) import Text.Pandoc.Lua @@ -84,7 +84,7 @@ assertFilterConversion msg filterPath docIn docExpected = do docEither <- runIOorExplode $ runLuaFilter (Just "../data") ("lua" </> filterPath) [] docIn case docEither of - Left _ -> fail "lua filter failed" + Left _ -> fail "lua filter failed" Right docRes -> assertEqual msg docExpected docRes roundtripEqual :: (Eq a, FromLuaStack a, ToLuaStack a) => a -> IO Bool @@ -102,5 +102,5 @@ roundtripEqual x = (x ==) <$> roundtripped error ("not exactly one additional element on the stack: " ++ show size) res <- peekEither (-1) case res of - Left _ -> error "could not read from stack" - Right y -> return y + Left _ -> error "could not read from stack" + Right y -> return y diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index 71ebb6cce..421acaa8b 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -1,18 +1,18 @@ module Tests.Readers.Docx (tests) where import Codec.Archive.Zip -import qualified Data.ByteString.Lazy as B import qualified Data.ByteString as BS -import qualified Data.Text as T +import qualified Data.ByteString.Lazy as B import qualified Data.Map as M +import qualified Data.Text as T +import System.IO.Unsafe import Test.Tasty import Test.Tasty.HUnit import Tests.Helpers import Text.Pandoc -import Text.Pandoc.UTF8 as UTF8 import qualified Text.Pandoc.Class as P import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory) -import System.IO.Unsafe -- TODO temporary +import Text.Pandoc.UTF8 as UTF8 -- We define a wrapper around pandoc that doesn't normalize in the -- tests. Since we do our own normalization, we want to make sure diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 00a8cfc90..70f33d2b2 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -1,12 +1,12 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.HTML (tests) where +import Data.Text (Text) import Test.Tasty import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder -import Data.Text (Text) html :: Text -> Pandoc html = purely $ readHtml def diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs index ba9b8e289..99b49fd45 100644 --- a/test/Tests/Readers/LaTeX.hs +++ b/test/Tests/Readers/LaTeX.hs @@ -1,13 +1,13 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.LaTeX (tests) where +import Data.Text (Text) +import qualified Data.Text as T import Test.Tasty import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder -import Data.Text (Text) -import qualified Data.Text as T latex :: Text -> Pandoc latex = purely $ readLaTeX def{ diff --git a/test/Tests/Readers/Odt.hs b/test/Tests/Readers/Odt.hs index eed3a33b0..4b7058cf9 100644 --- a/test/Tests/Readers/Odt.hs +++ b/test/Tests/Readers/Odt.hs @@ -1,15 +1,15 @@ module Tests.Readers.Odt (tests) where import Control.Monad (liftM) -import qualified Data.ByteString.Lazy as B import qualified Data.ByteString as BS -import qualified Text.Pandoc.UTF8 as UTF8 +import qualified Data.ByteString.Lazy as B import qualified Data.Map as M import Data.Text (unpack) +import System.IO.Unsafe (unsafePerformIO) import Test.Tasty import Tests.Helpers import Text.Pandoc -import System.IO.Unsafe (unsafePerformIO) -- TODO temporary +import qualified Text.Pandoc.UTF8 as UTF8 defopts :: ReaderOptions defopts = def{ readerExtensions = getDefaultExtensions "odt" } diff --git a/test/Tests/Shared.hs b/test/Tests/Shared.hs index 5ea8d7ee4..6fdbda3dd 100644 --- a/test/Tests/Shared.hs +++ b/test/Tests/Shared.hs @@ -2,7 +2,7 @@ module Tests.Shared (tests) where import System.FilePath.Posix (joinPath) import Test.Tasty -import Test.Tasty.HUnit (assertBool, (@?=), testCase) +import Test.Tasty.HUnit (assertBool, testCase, (@?=)) import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder import Text.Pandoc.Shared diff --git a/test/Tests/Writers/Docx.hs b/test/Tests/Writers/Docx.hs index 9e6150abc..1537ea85d 100644 --- a/test/Tests/Writers/Docx.hs +++ b/test/Tests/Writers/Docx.hs @@ -1,18 +1,18 @@ module Tests.Writers.Docx (tests) where +import qualified Data.ByteString as BS import System.FilePath ((</>)) +import System.IO.Unsafe (unsafePerformIO) import Test.Tasty import Tests.Helpers import Text.Pandoc.Class (runIOorExplode, setUserDataDir) import Text.Pandoc.Definition import Text.Pandoc.Options -import Text.Pandoc.Walk import Text.Pandoc.Readers.Docx import Text.Pandoc.Readers.Native -import Text.Pandoc.Writers.Docx -import System.IO.Unsafe (unsafePerformIO) -- TODO temporary -import qualified Data.ByteString as BS import qualified Text.Pandoc.UTF8 as UTF8 +import Text.Pandoc.Walk +import Text.Pandoc.Writers.Docx type Options = (WriterOptions, ReaderOptions) @@ -35,7 +35,7 @@ compareOutput (wopts, ropts) nativeFileIn nativeFileOut = do -- different ghc versions... fixImages :: Inline -> Inline fixImages (Image attr alt (_,tit)) = Image attr alt ("image",tit) -fixImages x = x +fixImages x = x testCompareWithOptsIO :: Options -> String -> FilePath -> FilePath -> IO TestTree testCompareWithOptsIO opts name nativeFileIn nativeFileOut = do diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 5291a5ef0..e5c19c7bc 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -4,7 +4,7 @@ import Data.Text (unpack) import Test.Tasty import Tests.Helpers import Text.Pandoc -import Text.Pandoc.Arbitrary() +import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder muse :: (ToPandoc a) => a -> String diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs index acfc4c5cd..358354e42 100644 --- a/test/test-pandoc.hs +++ b/test/test-pandoc.hs @@ -7,17 +7,17 @@ import Test.Tasty import qualified Tests.Command import qualified Tests.Lua import qualified Tests.Old +import qualified Tests.Readers.Creole import qualified Tests.Readers.Docx import qualified Tests.Readers.EPUB import qualified Tests.Readers.HTML import qualified Tests.Readers.LaTeX import qualified Tests.Readers.Markdown +import qualified Tests.Readers.Muse import qualified Tests.Readers.Odt import qualified Tests.Readers.Org import qualified Tests.Readers.RST import qualified Tests.Readers.Txt2Tags -import qualified Tests.Readers.Muse -import qualified Tests.Readers.Creole import qualified Tests.Shared import qualified Tests.Writers.AsciiDoc import qualified Tests.Writers.ConTeXt @@ -26,12 +26,12 @@ import qualified Tests.Writers.Docx import qualified Tests.Writers.HTML import qualified Tests.Writers.LaTeX import qualified Tests.Writers.Markdown +import qualified Tests.Writers.Muse import qualified Tests.Writers.Native import qualified Tests.Writers.Org import qualified Tests.Writers.Plain import qualified Tests.Writers.RST import qualified Tests.Writers.TEI -import qualified Tests.Writers.Muse import Text.Pandoc.Shared (inDirectory) tests :: TestTree |