aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-27 20:28:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-27 20:28:29 -0700
commitff16db1aa306113132cc6cfaa70791a0db75e0a5 (patch)
treeb5a016232c62645a1276c30eb4b69356662c060e /test/Tests
parentbf54a6335a0d2ae3fdf03e60a84448476f651d59 (diff)
downloadpandoc-ff16db1aa306113132cc6cfaa70791a0db75e0a5.tar.gz
Automatic reformating by stylish-haskell.
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Command.hs6
-rw-r--r--test/Tests/Lua.hs16
-rw-r--r--test/Tests/Readers/Docx.hs8
-rw-r--r--test/Tests/Readers/HTML.hs2
-rw-r--r--test/Tests/Readers/LaTeX.hs4
-rw-r--r--test/Tests/Readers/Odt.hs6
-rw-r--r--test/Tests/Shared.hs2
-rw-r--r--test/Tests/Writers/Docx.hs10
-rw-r--r--test/Tests/Writers/Muse.hs2
9 files changed, 28 insertions, 28 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