@@ -5,13 +5,13 @@ import Data.List (intersperse)
55import Data.Text (Text)
66import qualified Data.Text as T
77import Test.Tasty
8−-- import Test.Tasty.QuickCheck
8+import Test.Tasty.QuickCheck
99import Tests.Helpers
1010import Text.Pandoc
1111import Text.Pandoc.Arbitrary ()
1212import Text.Pandoc.Builder
1313import Text.Pandoc.Shared (underlineSpan)
14−-- import Text.Pandoc.Walk (walk)
14+import Text.Pandoc.Walk (walk)
1515
1616amuse :: Text -> Pandoc
1717amuse = purely $ readMuse def { readerExtensions = extensionsFromList [Ext_amuse]}
@@ -27,19 +27,19 @@ infix 4 =:
2727spcSep :: [Inlines] -> Inlines
2828spcSep = mconcat . intersperse space
2929
30−{-
31−-- Tables and code blocks don't round-trip yet
30+-- Tables and definition lists don't round-trip yet
3231
33−removeTables :: Block -> Block
34−removeTables (Table{}) = Para [Str "table was here"]
35−removeTables x = x
32+makeRoundTrip :: Block -> Block
33+makeRoundTrip (Table{}) = Para [Str "table was here"]
34+makeRoundTrip (DefinitionList{}) = Para [Str "deflist was here"]
35+makeRoundTrip x = x
3636
3737-- Demand that any AST produced by Muse reader and written by Muse writer can be read back exactly the same way.
3838-- Currently we remove code blocks and tables and compare third rewrite to the second.
3939-- First and second rewrites are not equal yet.
4040roundTrip :: Block -> Bool
4141roundTrip b = d'' == d'''
42− where d = walk removeTables $ Pandoc nullMeta [b]
42+ where d = walk makeRoundTrip $ Pandoc nullMeta [b]
4343 d' = rewrite d
4444 d'' = rewrite d'
4545 d''' = rewrite d''
@@ -47,7 +47,6 @@ roundTrip b = d'' == d'''
4747 (purely $ writeMuse def { writerExtensions = extensionsFromList [Ext_amuse]
4848 , writerWrapText = WrapPreserve
4949 })
50−-}
5150
5251tests :: [TestTree]
5352tests =
@@ -200,7 +199,7 @@ tests =
200199 ]
201200
202201 , testGroup "Blocks"
203− [ -- testProperty "Round trip" roundTrip,
202+ [ testProperty "Round trip" roundTrip,
204203 "Block elements end paragraphs" =:
205204 T.unlines [ "First paragraph"
206205 , "----"