From 1dfda7e204a1304ac502a1045505430134516b7d Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 11 Feb 2018 18:28:37 +0300 Subject: 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. --- test/Tests/Readers/Muse.hs | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'test/Tests') 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" =: - "
Foo bar
" =?> + T.unlines [ "
" + , "Foo bar" + , "
" + ] =?> divWith nullAttr (para "Foo bar") , "Div with id" =: - "
Foo bar
" =?> + T.unlines [ "
" + , "Foo bar" + , "
" + ] =?> divWith ("foo", [], []) (para "Foo bar") ] , "Verse" =: @@ -290,7 +296,12 @@ tests = , "\160\160\160is here" ] ] - , "Quote tag" =: "Hello, world" =?> blockQuote (para $ text "Hello, world") + , "Quote tag" =: + T.unlines [ "" + , "Hello, world" + , "" + ] + =?> blockQuote (para $ text "Hello, world") , "Verse tag" =: T.unlines [ "" , "" @@ -431,8 +442,18 @@ tests = ] =?> para "\n\\newpage\n" ] - , "Center" =: "
Hello, world
" =?> para (text "Hello, world") - , "Right" =: "Hello, world" =?> para (text "Hello, world") + , "Center" =: + T.unlines [ "
" + , "Hello, world" + , "
" + ] =?> + para (text "Hello, world") + , "Right" =: + T.unlines [ "" + , "Hello, world" + , "" + ] =?> + para (text "Hello, world") , testGroup "Comments" [ "Comment tag" =: "\nThis is a comment\n" =?> (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 - [ " 1. First" - , "" - , " 2. Second" - , "" - , " 3. Third" - ] =?> - blockQuote (orderedListWith (1, Decimal, Period) [ para "First" - , para "Second" - , para "Third" - ]) ] ] -- cgit v1.2.3