summaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Muse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Readers/Muse.hs')
-rw-r--r--test/Tests/Readers/Muse.hs27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 967a63ac9..5f379c44b 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -28,15 +28,9 @@ spcSep :: [Inlines] -> Inlines
spcSep = mconcat . intersperse space
-- Tables don't round-trip yet
--- Definition lists with multiple descriptions are supported by writer, but not reader yet
-
-singleDescription :: ([Inline], [[Block]]) -> ([Inline], [[Block]])
-singleDescription (a, x:_) = (a, [x])
-singleDescription x = x
-
+--
makeRoundTrip :: Block -> Block
makeRoundTrip Table{} = Para [Str "table was here"]
-makeRoundTrip (DefinitionList items) = DefinitionList $ map singleDescription items
makeRoundTrip x = x
-- Demand that any AST produced by Muse reader and written by Muse writer can be read back exactly the same way.
@@ -1092,6 +1086,25 @@ tests =
("Fourth", [ definitionList [ ("Fifth", [ para "Sixth"] ) ] ] ) ] ] )
, ("Seventh", [ para "Eighth" ])
]
+ , testGroup "Definition lists with multiple descriptions"
+ [ "Correctly indented second description" =:
+ T.unlines
+ [ " First term :: first description"
+ , " :: second description"
+ ] =?>
+ definitionList [ ("First term", [ para "first description"
+ , para "second description"
+ ])
+ ]
+ , "Incorrectly indented second description" =:
+ T.unlines
+ [ " First term :: first description"
+ , " :: second description"
+ ] =?>
+ definitionList [ ("First term", [ para "first description" ])
+ , ("", [ para "second description" ])
+ ]
+ ]
, "Two blank lines separate definition lists" =:
T.unlines
[ " First :: list"