From 2230371304f299ca7333af8ad0ee7bcd099a4aa0 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 9 Sep 2017 11:51:36 +0300 Subject: Muse reader: debug inline code markup --- test/Tests/Readers/Muse.hs | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'test/Tests/Readers/Muse.hs') diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index dac167a92..6f602d7c3 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -72,9 +72,39 @@ tests = , "Linebreak" =: "Line
break" =?> para ("Line" <> linebreak <> "break") - , "Code" =: "=foo(bar)=" =?> para (code "foo(bar)") + , testGroup "Code markup" + [ "Code" =: "=foo(bar)=" =?> para (code "foo(bar)") - , "Not code" =: "a=b= =c=d" =?> para (text "a=b= =c=d") + , "Not code" =: "a=b= =c=d" =?> para (text "a=b= =c=d") + + -- Emacs Muse 3.20 parses this as code, we follow Amusewiki + , "Not code if closing = is detached" =: "=this is not a code =" =?> para "=this is not a code =" + + , "Not code if opening = is detached" =: "= this is not a code=" =?> para "= this is not a code=" + + , "One character code" =: "=c=" =?> para (code "c") + + , "Three = characters is not a code" =: "===" =?> para "===" + + , "Multiline code markup" =: + "foo =bar\nbaz= end of code" =?> + para (text "foo " <> code "bar\nbaz" <> text " end of code") + +{- Emacs Muse 3.20 has a bug: it publishes + -

foo bar + - + - baz foo

+ - which is displayed as one paragraph by browsers. + - We follow Amusewiki here and avoid joining paragraphs. + -} + , "No multiparagraph code" =: + T.unlines [ "foo =bar" + , "" + , "baz= foo" + ] =?> + para "foo =bar" <> + para "baz= foo" + ] , "Code tag" =: "foo(bar)" =?> para (code "foo(bar)") -- cgit v1.2.3