summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-02-11 18:28:37 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-02-11 19:35:58 +0300
commit1dfda7e204a1304ac502a1045505430134516b7d (patch)
tree4af81197967969630880cb57a566fec4a761dba7
parentcadcf62ff39d4bec569622592b1a970714b66d0f (diff)
Muse reader: require that block tags are on separate lines
Text::Amuse already explicitly requires it anyway. Supporting block tags on the same line as contents makes it hard to combine closing tag parsers with indentation parsers. Being able to combine parsers is required for no-reparsing refactoring of Muse reader.
-rw-r--r--test/Tests/Readers/Muse.hs45
1 files changed, 26 insertions, 19 deletions
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 1be73ea5c..f0fa68f0c 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -259,10 +259,16 @@ tests =
blockQuote (para "This is a quotation\nwith a continuation")
, testGroup "Div"
[ "Div without id" =:
- "<div>Foo bar</div>" =?>
+ T.unlines [ "<div>"
+ , "Foo bar"
+ , "</div>"
+ ] =?>
divWith nullAttr (para "Foo bar")
, "Div with id" =:
- "<div id=\"foo\">Foo bar</div>" =?>
+ T.unlines [ "<div id=\"foo\">"
+ , "Foo bar"
+ , "</div>"
+ ] =?>
divWith ("foo", [], []) (para "Foo bar")
]
, "Verse" =:
@@ -290,7 +296,12 @@ tests =
, "\160\160\160is here"
]
]
- , "Quote tag" =: "<quote>Hello, world</quote>" =?> blockQuote (para $ text "Hello, world")
+ , "Quote tag" =:
+ T.unlines [ "<quote>"
+ , "Hello, world"
+ , "</quote>"
+ ]
+ =?> blockQuote (para $ text "Hello, world")
, "Verse tag" =:
T.unlines [ "<verse>"
, ""
@@ -431,8 +442,18 @@ tests =
] =?>
para "<literal style=\"latex\">\n\\newpage\n</literal>"
]
- , "Center" =: "<center>Hello, world</center>" =?> para (text "Hello, world")
- , "Right" =: "<right>Hello, world</right>" =?> para (text "Hello, world")
+ , "Center" =:
+ T.unlines [ "<center>"
+ , "Hello, world"
+ , "</center>"
+ ] =?>
+ para (text "Hello, world")
+ , "Right" =:
+ T.unlines [ "<right>"
+ , "Hello, world"
+ , "</right>"
+ ] =?>
+ para (text "Hello, world")
, testGroup "Comments"
[ "Comment tag" =: "<comment>\nThis is a comment\n</comment>" =?> (mempty::Blocks)
, "Line comment" =: "; Comment" =?> (mempty::Blocks)
@@ -1069,19 +1090,5 @@ tests =
, para "Second"
, para "Third"
])
- -- Amusewiki requires block tags to be on separate lines,
- -- but Emacs Muse allows them to be on the same line as contents.
- , "List inside an inline tag" =:
- T.unlines
- [ "<quote> 1. First"
- , ""
- , " 2. Second"
- , ""
- , " 3. Third</quote>"
- ] =?>
- blockQuote (orderedListWith (1, Decimal, Period) [ para "First"
- , para "Second"
- , para "Third"
- ])
]
]