aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers/Muse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Writers/Muse.hs')
-rw-r--r--test/Tests/Writers/Muse.hs50
1 files changed, 39 insertions, 11 deletions
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index 50c0e78eb..f44097f9e 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -354,23 +354,51 @@ tests = [ testGroup "block elements"
, "do not escape ; inside paragraph" =: text "foo ; bar" =?> "foo ; bar"
]
, testGroup "emphasis"
- [ "emph" =: emph (text "foo") =?> "<em>foo</em>"
- , "strong" =: strong (text "foo") =?> "<strong>foo</strong>"
+ [ "emphasis" =: emph (text "foo") =?> "*foo*"
+ , "emphasis inside word" =: text "foo" <> emph (text "bar") <> text "baz" =?> "foo<em>bar</em>baz"
+ , "emphasis before comma" =: emph (text "foo") <> text ", bar" =?> "*foo*, bar"
+ , "emphasis before period" =: emph (text "foobar") <> text "." =?> "*foobar*."
+ , "empty emphasis" =: emph mempty =?> "<em></em>"
+ , "empty strong" =: strong mempty =?> "<strong></strong>"
+ , "empty strong emphasis" =: strong (emph mempty) =?> "**<em></em>**"
+ , "empty emphasized strong" =: emph (strong mempty) =?> "*<strong></strong>*"
+ , "strong" =: strong (text "foo") =?> "**foo**"
+ , "strong inside word" =: text "foo" <> strong (text "bar") <> text "baz" =?> "foo<strong>bar</strong>baz"
+ , "strong emphasis" =: strong (emph (text "foo")) =?> "***foo***"
+ , "strong after emphasis" =: emph (text "foo") <> strong (text "bar") =?> "*foo*<strong>bar</strong>"
+ , "strong emphasis after emphasis" =: emph (text "foo") <> strong (emph (text "bar")) =?> "*foo*<strong>*bar*</strong>"
+ , "strong in the end of emphasis" =: emph (text "foo" <> strong (text "bar")) =?> "*foo<strong>bar</strong>*"
, "strikeout" =: strikeout (text "foo") =?> "<del>foo</del>"
+ , "space at the beginning of emphasis" =: emph (text " foo") =?> "<em> foo</em>"
+ , "space at the end of emphasis" =: emph (text "foo ") =?> "<em>foo </em>"
+ , "space at the beginning of strong" =: strong (text " foo") =?> "<strong> foo</strong>"
+ , "space at the end of strong" =: strong (text "foo ") =?> "<strong>foo </strong>"
+ , "space at the beginning of strong emphasis" =: strong (emph (text " foo")) =?> "**<em> foo</em>**"
+ , "space at the end of strong emphasis" =: strong (emph (text "foo ")) =?> "**<em>foo </em>**"
+ , "space at the beginning of emphasiszed strong" =: emph (strong (text " foo")) =?> "*<strong> foo</strong>*"
+ , "space at the end of emphasized strong" =: emph (strong (text "foo ")) =?> "*<strong>foo </strong>*"
]
, "superscript" =: superscript (text "foo") =?> "<sup>foo</sup>"
, "subscript" =: subscript (text "foo") =?> "<sub>foo</sub>"
- , "smallcaps" =: smallcaps (text "foo") =?> "<em>foo</em>"
- , "smallcaps near emphasis" =: emph (str "foo") <> smallcaps (str "bar") =?> "<em>foobar</em>"
+ , "smallcaps" =: smallcaps (text "foo") =?> "*foo*"
+ , "smallcaps near emphasis" =: emph (str "foo") <> smallcaps (str "bar") =?> "*foobar*"
, "single quoted" =: singleQuoted (text "foo") =?> "‘foo’"
, "double quoted" =: doubleQuoted (text "foo") =?> "“foo”"
-- Cite is trivial
, testGroup "code"
- [ "simple" =: code "foo" =?> "<code>foo</code>"
+ [ "simple" =: code "foo" =?> "=foo="
+ , "empty" =: code "" =?> "<code></code>"
+ , "space" =: code " " =?> "<code> </code>"
+ , "space at the beginning" =: code " foo" =?> "<code> foo</code>"
+ , "space at the end" =: code "foo " =?> "<code>foo </code>"
+ , "use tags for =" =: code "foo = bar" =?> "<code>foo = bar</code>"
, "escape tag" =: code "<code>foo = bar</code> baz" =?> "<code><code>foo = bar<</code><code>/code> baz</code>"
- , "normalization with attributes" =: codeWith ("",["haskell"],[]) "foo" <> code "bar" =?> "<code>foobar</code>"
- , "normalization" =: code "</co" <> code "de>" =?> "<code><</code><code>/code></code>"
- , "normalization with empty string" =: code "</co" <> str "" <> code "de>" =?> "<code><</code><code>/code></code>"
+ , "normalization with attributes" =: codeWith ("",["haskell"],[]) "foo" <> code "bar" =?> "=foobar="
+ , "code tag" =: code "<code>foo</code>" =?> "=<code>foo</code>="
+ , "normalization" =: code "</co" <> code "de>" <> code "=" =?> "<code><</code><code>/code>=</code>"
+ , "normalization with empty string" =: code "</co" <> str "" <> code "de>" <> code "=" =?> "<code><</code><code>/code>=</code>"
+ , "emphasized code" =: emph (code "foo") =?> "*=foo=*"
+ , "strong code" =: strong (code "foo") =?> "**=foo=**"
]
, testGroup "spaces"
[ "space" =: text "a" <> space <> text "b" =?> "a b"
@@ -385,7 +413,7 @@ tests = [ testGroup "block elements"
, testGroup "math"
[ "inline math" =: math "2^3" =?> "2<sup>3</sup>"
, "display math" =: displayMath "2^3" =?> "2<sup>3</sup>"
- , "multiple letters in inline math" =: math "abc" =?> "<em>abc</em>"
+ , "multiple letters in inline math" =: math "abc" =?> "*abc*"
, "expand math before normalization" =: math "[" <> str "2]" =?> "<verbatim>[2]</verbatim>"
, "multiple math expressions inside one inline list" =: math "5_4" <> text ", " <> displayMath "3^2" =?> "5<sub>4</sub>, 3<sup>2</sup>"
]
@@ -461,7 +489,7 @@ tests = [ testGroup "block elements"
"<em>foo</em>bar"
, "emph quoted" =:
para (doubleQuoted (emph (text "foo"))) =?>
- "“<em>foo</em>”"
+ "“*foo*”"
, "strong word before" =:
para (text "foo" <> strong (text "bar")) =?>
"foo<strong>bar</strong>"
@@ -470,7 +498,7 @@ tests = [ testGroup "block elements"
"<strong>foo</strong>bar"
, "strong quoted" =:
para (singleQuoted (strong (text "foo"))) =?>
- "‘<strong>foo</strong>’"
+ "‘**foo**’"
]
]
]