From c686010a92f35eaba4056d502e47d875c9d98e94 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 4 Feb 2011 18:33:08 -0800 Subject: Added cCommented-out round-trip property in markdown reader test. --- src/Tests/Readers/Markdown.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/Tests') 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 +-- ] ] -- cgit v1.2.3