aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-02-04 18:33:08 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-02-04 18:33:08 -0800
commitc686010a92f35eaba4056d502e47d875c9d98e94 (patch)
tree13343f417d5283b19a5d576bab3fde397fb297c7
parent221177c272cbe21513b3f012959a10530ece720d (diff)
downloadpandoc-c686010a92f35eaba4056d502e47d875c9d98e94.tar.gz
Added cCommented-out round-trip property in markdown reader test.
-rw-r--r--src/Tests/Readers/Markdown.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs
index eae03fcae..feec8fa65 100644
--- a/src/Tests/Readers/Markdown.hs
+++ b/src/Tests/Readers/Markdown.hs
@@ -6,6 +6,7 @@ import Test.Framework
import Tests.Helpers
import Tests.Arbitrary()
import Text.Pandoc.Builder
+-- import Text.Pandoc.Shared ( normalize )
import Text.Pandoc
markdown :: String -> Pandoc
@@ -16,6 +17,19 @@ infix 5 =:
=> String -> (String, c) -> Test
(=:) = test markdown
+{-
+p_markdown_round_trip :: Block -> Bool
+p_markdown_round_trip b = matches d' d''
+ where d' = normalize $ Pandoc (Meta [] [] []) [b]
+ d'' = normalize
+ $ readMarkdown defaultParserState{ stateSmart = True }
+ $ writeMarkdown defaultWriterOptions d'
+ matches (Pandoc _ [Plain []]) (Pandoc _ []) = True
+ matches (Pandoc _ [Para []]) (Pandoc _ []) = True
+ matches (Pandoc _ [Plain xs]) (Pandoc _ [Para xs']) = xs == xs'
+ matches x y = x == y
+-}
+
tests :: [Test]
tests = [ testGroup "inline code"
[ "with attribute" =:
@@ -34,4 +48,8 @@ tests = [ testGroup "inline code"
"[^1]\n\n[^1]: my note\n \n in note\n"
=?> para (note (para "my note" +++ para "in note"))
]
+-- the round-trip properties frequently fail
+-- , testGroup "round trip"
+-- [ property "p_markdown_round_trip" p_markdown_round_trip
+-- ]
]