aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Helpers.hs12
-rw-r--r--tests/Tests/Old.hs5
-rw-r--r--tests/Tests/Readers/Markdown.hs2
-rw-r--r--tests/Tests/Writers/ConTeXt.hs5
-rw-r--r--tests/Tests/Writers/HTML.hs2
-rw-r--r--tests/Tests/Writers/LaTeX.hs2
-rw-r--r--tests/Tests/Writers/Markdown.hs2
-rw-r--r--tests/Tests/Writers/Native.hs4
8 files changed, 16 insertions, 18 deletions
diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs
index 66879efed..86a92fb0c 100644
--- a/tests/Tests/Helpers.hs
+++ b/tests/Tests/Helpers.hs
@@ -17,8 +17,8 @@ import Test.Framework
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2
import Test.HUnit (assertBool)
-import Text.Pandoc.Shared (normalize, defaultWriterOptions,
- WriterOptions(..), removeTrailingSpace)
+import Text.Pandoc.Shared (normalize, removeTrailingSpace)
+import Text.Pandoc.Options
import Text.Pandoc.Writers.Native (writeNative)
import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Language.Haskell.TH.Syntax (Q, runIO)
@@ -85,18 +85,16 @@ class ToString a where
toString :: a -> String
instance ToString Pandoc where
- toString d = writeNative defaultWriterOptions{ writerStandalone = s }
- $ toPandoc d
+ toString d = writeNative def{ writerStandalone = s } $ toPandoc d
where s = case d of
(Pandoc (Meta [] [] []) _) -> False
_ -> True
instance ToString Blocks where
- toString = writeNative defaultWriterOptions . toPandoc
+ toString = writeNative def . toPandoc
instance ToString Inlines where
- toString = removeTrailingSpace . writeNative defaultWriterOptions .
- toPandoc
+ toString = removeTrailingSpace . writeNative def . toPandoc
instance ToString String where
toString = id
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs
index e60f390df..8899fef6f 100644
--- a/tests/Tests/Old.hs
+++ b/tests/Tests/Old.hs
@@ -10,7 +10,8 @@ import System.FilePath ( (</>), (<.>) )
import System.Directory
import System.Exit
import Data.Algorithm.Diff
-import Text.Pandoc.Shared ( normalize, defaultWriterOptions )
+import Text.Pandoc.Shared ( normalize )
+import Text.Pandoc.Options
import Text.Pandoc.Writers.Native ( writeNative )
import Text.Pandoc.Readers.Native ( readNative )
import Prelude hiding ( readFile )
@@ -142,7 +143,7 @@ lhsReaderTest :: String -> Test
lhsReaderTest format =
testWithNormalize normalizer "lhs" ["-r", format, "-w", "native"]
("lhs-test" <.> format) "lhs-test.native"
- where normalizer = writeNative defaultWriterOptions . normalize . readNative
+ where normalizer = writeNative def . normalize . readNative
writerTests :: String -> [Test]
writerTests format
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
index 543802795..dbb96c15f 100644
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -26,7 +26,7 @@ p_markdown_round_trip b = matches d' d''
where d' = normalize $ Pandoc (Meta [] [] []) [b]
d'' = normalize
$ readMarkdown def { readerSmart = True }
- $ writeMarkdown defaultWriterOptions d'
+ $ writeMarkdown def d'
matches (Pandoc _ [Plain []]) (Pandoc _ []) = True
matches (Pandoc _ [Para []]) (Pandoc _ []) = True
matches (Pandoc _ [Plain xs]) (Pandoc _ [Para xs']) = xs == xs'
diff --git a/tests/Tests/Writers/ConTeXt.hs b/tests/Tests/Writers/ConTeXt.hs
index beb6411f0..2cb8ececa 100644
--- a/tests/Tests/Writers/ConTeXt.hs
+++ b/tests/Tests/Writers/ConTeXt.hs
@@ -8,11 +8,10 @@ import Tests.Helpers
import Tests.Arbitrary()
context :: (ToString a, ToPandoc a) => a -> String
-context = writeConTeXt defaultWriterOptions . toPandoc
+context = writeConTeXt def . toPandoc
context' :: (ToString a, ToPandoc a) => a -> String
-context' = writeConTeXt defaultWriterOptions{ writerWrapText = False }
- . toPandoc
+context' = writeConTeXt def{ writerWrapText = False } . toPandoc
{-
"my test" =: X =?> Y
diff --git a/tests/Tests/Writers/HTML.hs b/tests/Tests/Writers/HTML.hs
index 8561aa421..5d6e301c5 100644
--- a/tests/Tests/Writers/HTML.hs
+++ b/tests/Tests/Writers/HTML.hs
@@ -9,7 +9,7 @@ import Tests.Arbitrary()
import Text.Pandoc.Highlighting (languages) -- null if no hl support
html :: (ToString a, ToPandoc a) => a -> String
-html = writeHtmlString defaultWriterOptions{ writerWrapText = False } . toPandoc
+html = writeHtmlString def{ writerWrapText = False } . toPandoc
{-
"my test" =: X =?> Y
diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs
index 7987716f3..16e0c3f23 100644
--- a/tests/Tests/Writers/LaTeX.hs
+++ b/tests/Tests/Writers/LaTeX.hs
@@ -8,7 +8,7 @@ import Tests.Helpers
import Tests.Arbitrary()
latex :: (ToString a, ToPandoc a) => a -> String
-latex = writeLaTeX defaultWriterOptions . toPandoc
+latex = writeLaTeX def . toPandoc
{-
"my test" =: X =?> Y
diff --git a/tests/Tests/Writers/Markdown.hs b/tests/Tests/Writers/Markdown.hs
index d90dc83b1..22ce8b27c 100644
--- a/tests/Tests/Writers/Markdown.hs
+++ b/tests/Tests/Writers/Markdown.hs
@@ -8,7 +8,7 @@ import Tests.Helpers
import Tests.Arbitrary()
markdown :: (ToString a, ToPandoc a) => a -> String
-markdown = writeMarkdown defaultWriterOptions . toPandoc
+markdown = writeMarkdown def . toPandoc
{-
"my test" =: X =?> Y
diff --git a/tests/Tests/Writers/Native.hs b/tests/Tests/Writers/Native.hs
index 19740e0f4..e199cf94e 100644
--- a/tests/Tests/Writers/Native.hs
+++ b/tests/Tests/Writers/Native.hs
@@ -8,11 +8,11 @@ import Tests.Arbitrary()
p_write_rt :: Pandoc -> Bool
p_write_rt d =
- read (writeNative defaultWriterOptions{ writerStandalone = True } d) == d
+ read (writeNative def{ writerStandalone = True } d) == d
p_write_blocks_rt :: [Block] -> Bool
p_write_blocks_rt bs = length bs > 20 ||
- read (writeNative defaultWriterOptions (Pandoc (Meta [] [] []) bs)) ==
+ read (writeNative def (Pandoc (Meta [] [] []) bs)) ==
bs
tests :: [Test]