Muse reader: compare first rewrite to the second in round-trip test

This commit is contained in:
Alexander Krotov 2018-03-12 15:09:27 +03:00
parent bf16a9c78a
commit 3ee45a7357

View file

@ -36,14 +36,12 @@ makeRoundTrip (OrderedList (start, UpperAlpha, _) items) = OrderedList (start, D
makeRoundTrip x = x
-- Demand that any AST produced by Muse reader and written by Muse writer can be read back exactly the same way.
-- Currently we remove tables and compare third rewrite to the second.
-- First and second rewrites are not equal yet.
-- Currently we remove tables and compare first rewrite to the second.
roundTrip :: Block -> Bool
roundTrip b = d'' == d'''
roundTrip b = d' == d''
where d = walk makeRoundTrip $ Pandoc nullMeta [b]
d' = rewrite d
d'' = rewrite d'
d''' = rewrite d''
rewrite = amuse . T.pack . (++ "\n") . T.unpack .
purely (writeMuse def { writerExtensions = extensionsFromList [Ext_amuse]
, writerWrapText = WrapPreserve