diff options
Diffstat (limited to 'test/Tests/Readers')
-rw-r--r-- | test/Tests/Readers/Docx.hs | 14 | ||||
-rw-r--r-- | test/Tests/Readers/EPUB.hs | 10 | ||||
-rw-r--r-- | test/Tests/Readers/HTML.hs | 5 | ||||
-rw-r--r-- | test/Tests/Readers/LaTeX.hs | 5 | ||||
-rw-r--r-- | test/Tests/Readers/Markdown.hs | 5 | ||||
-rw-r--r-- | test/Tests/Readers/Odt.hs | 8 | ||||
-rw-r--r-- | test/Tests/Readers/Org.hs | 7 | ||||
-rw-r--r-- | test/Tests/Readers/RST.hs | 8 | ||||
-rw-r--r-- | test/Tests/Readers/Txt2Tags.hs | 8 |
9 files changed, 32 insertions, 38 deletions
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index e73065012..6e0ea127c 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -1,15 +1,15 @@ module Tests.Readers.Docx (tests) where -import Text.Pandoc -import Tests.Helpers -import Test.Framework -import Test.HUnit (assertBool) -import Test.Framework.Providers.HUnit +import Codec.Archive.Zip import qualified Data.ByteString.Lazy as B import qualified Data.Map as M -import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory) -import Codec.Archive.Zip +import Test.Framework +import Test.Framework.Providers.HUnit +import Test.HUnit (assertBool) +import Tests.Helpers +import Text.Pandoc import qualified Text.Pandoc.Class as P +import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory) -- 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/EPUB.hs b/test/Tests/Readers/EPUB.hs index 9190671c3..f343a75d8 100644 --- a/test/Tests/Readers/EPUB.hs +++ b/test/Tests/Readers/EPUB.hs @@ -1,13 +1,13 @@ module Tests.Readers.EPUB (tests) where -import Text.Pandoc.Options +import qualified Data.ByteString.Lazy as BL import Test.Framework -import Test.HUnit (assertBool) import Test.Framework.Providers.HUnit -import qualified Data.ByteString.Lazy as BL -import Text.Pandoc.Readers.EPUB -import Text.Pandoc.MediaBag (MediaBag, mediaDirectory) +import Test.HUnit (assertBool) import qualified Text.Pandoc.Class as P +import Text.Pandoc.MediaBag (MediaBag, mediaDirectory) +import Text.Pandoc.Options +import Text.Pandoc.Readers.EPUB getMediaBag :: FilePath -> IO MediaBag getMediaBag fp = do diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index a1533e42a..0b97f68f8 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -1,12 +1,11 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.HTML (tests) where -import Text.Pandoc.Definition import Test.Framework import Tests.Helpers -import Text.Pandoc.Arbitrary() -import Text.Pandoc.Builder import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder html :: String -> Pandoc html = purely $ readHtml def diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs index d8572b15b..423735243 100644 --- a/test/Tests/Readers/LaTeX.hs +++ b/test/Tests/Readers/LaTeX.hs @@ -1,12 +1,11 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.LaTeX (tests) where -import Text.Pandoc.Definition import Test.Framework import Tests.Helpers -import Text.Pandoc.Arbitrary() -import Text.Pandoc.Builder import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder latex :: String -> Pandoc latex = purely $ readLaTeX def{ diff --git a/test/Tests/Readers/Markdown.hs b/test/Tests/Readers/Markdown.hs index 65edf7c38..8903f767f 100644 --- a/test/Tests/Readers/Markdown.hs +++ b/test/Tests/Readers/Markdown.hs @@ -1,12 +1,11 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.Markdown (tests) where -import Text.Pandoc.Definition import Test.Framework import Tests.Helpers -import Text.Pandoc.Arbitrary() -import Text.Pandoc.Builder import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder markdown :: String -> Pandoc markdown = purely $ readMarkdown def { readerExtensions = diff --git a/test/Tests/Readers/Odt.hs b/test/Tests/Readers/Odt.hs index 653252c5c..c31af38fc 100644 --- a/test/Tests/Readers/Odt.hs +++ b/test/Tests/Readers/Odt.hs @@ -1,11 +1,11 @@ module Tests.Readers.Odt (tests) where -import Control.Monad ( liftM ) -import Text.Pandoc -import Tests.Helpers -import Test.Framework +import Control.Monad (liftM) import qualified Data.ByteString.Lazy as B import qualified Data.Map as M +import Test.Framework +import Tests.Helpers +import Text.Pandoc defopts :: ReaderOptions defopts = def{ readerExtensions = getDefaultExtensions "odt" } diff --git a/test/Tests/Readers/Org.hs b/test/Tests/Readers/Org.hs index ef0530b37..586526815 100644 --- a/test/Tests/Readers/Org.hs +++ b/test/Tests/Readers/Org.hs @@ -1,16 +1,15 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.Org (tests) where -import Text.Pandoc.Definition +import Data.List (intersperse) import Test.Framework import Tests.Helpers -import Text.Pandoc.Builder import Text.Pandoc -import Data.List (intersperse) +import Text.Pandoc.Builder org :: String -> Pandoc org = purely $ readOrg def{ readerExtensions = getDefaultExtensions "org" } - + orgSmart :: String -> Pandoc orgSmart = purely $ readOrg def { readerExtensions = enableExtension Ext_smart $ getDefaultExtensions "org" } diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs index 464720496..7a0a3de28 100644 --- a/test/Tests/Readers/RST.hs +++ b/test/Tests/Readers/RST.hs @@ -1,12 +1,12 @@ -{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} module Tests.Readers.RST (tests) where -import Text.Pandoc.Definition import Test.Framework import Tests.Helpers -import Text.Pandoc.Arbitrary() -import Text.Pandoc.Builder import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder rst :: String -> Pandoc rst = purely $ readRST def{ readerStandalone = True } diff --git a/test/Tests/Readers/Txt2Tags.hs b/test/Tests/Readers/Txt2Tags.hs index 46831d86f..27ced0f5a 100644 --- a/test/Tests/Readers/Txt2Tags.hs +++ b/test/Tests/Readers/Txt2Tags.hs @@ -1,16 +1,14 @@ {-# LANGUAGE OverloadedStrings #-} module Tests.Readers.Txt2Tags (tests) where -import Text.Pandoc.Definition +import Data.List (intersperse) import Test.Framework import Tests.Helpers -import Text.Pandoc.Arbitrary() -import Text.Pandoc.Builder import Text.Pandoc -import Data.List (intersperse) +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder import Text.Pandoc.Class - t2t :: String -> Pandoc -- t2t = handleError . readTxt2Tags (T2TMeta "date" "mtime" "in" "out") def t2t = purely $ \s -> do |