@@ -1,4 +1,5 @@
11{-# LANGUAGE NoImplicitPrelude #-}
2+{-# LANGUAGE OverloadedStrings #-}
23module Tests.Writers.Muse (tests) where
34
45import Prelude
@@ -27,96 +28,96 @@ infix 4 =:
2728
2829noteLocationTestDoc :: Blocks
2930noteLocationTestDoc =
30− header 1 (text "First Header") <>
31− para (text "This is a footnote." <>
32− note (para (text "First note."))) <>
33− blockQuote (para (text "A note inside a block quote." <>
34− note (para (text "The second note."))) <>
35− para (text "A second paragraph.")) <>
36− header 1 (text "Second Header") <>
37− para (text "Some more text.")
31+ header 1 "First Header" <>
32+ para ("This is a footnote." <>
33+ note (para "First note.")) <>
34+ blockQuote (para ("A note inside a block quote." <>
35+ note (para "The second note.")) <>
36+ para "A second paragraph.") <>
37+ header 1 "Second Header" <>
38+ para "Some more text."
3839
3940noteLocationTests :: TestTree
4041noteLocationTests = testGroup "note location"
4142 [ test (museWithOpts defopts {writerReferenceLocation=EndOfDocument})
4243 "footnotes at the end of document" $
4344 noteLocationTestDoc =?>
44− (unlines [ "* First Header"
45− , ""
46− , "This is a footnote.[1]"
47− , ""
48− , "<quote>"
49− , "A note inside a block quote.[2]"
50− , ""
51− , "A second paragraph."
52− , "</quote>"
53− , ""
54− , "* Second Header"
55− , ""
56− , "Some more text."
57− , ""
58− , "[1] First note."
59− , ""
60− , "[2] The second note."
61− ])
45+ unlines [ "* First Header"
46+ , ""
47+ , "This is a footnote.[1]"
48+ , ""
49+ , "<quote>"
50+ , "A note inside a block quote.[2]"
51+ , ""
52+ , "A second paragraph."
53+ , "</quote>"
54+ , ""
55+ , "* Second Header"
56+ , ""
57+ , "Some more text."
58+ , ""
59+ , "[1] First note."
60+ , ""
61+ , "[2] The second note."
62+ ]
6263 , test (museWithOpts defopts {writerReferenceLocation=EndOfBlock})
6364 "footnotes at the end of block" $
6465 noteLocationTestDoc =?>
65− (unlines [ "* First Header"
66− , ""
67− , "This is a footnote.[1]"
68− , ""
69− , "[1] First note."
70− , ""
71− , "<quote>"
72− , "A note inside a block quote.[2]"
73− , ""
74− , "[2] The second note."
75− , ""
76− , "A second paragraph."
77− , "</quote>"
78− , ""
79− , "* Second Header"
80− , ""
81− , "Some more text."
82− ])
66+ unlines [ "* First Header"
67+ , ""
68+ , "This is a footnote.[1]"
69+ , ""
70+ , "[1] First note."
71+ , ""
72+ , "<quote>"
73+ , "A note inside a block quote.[2]"
74+ , ""
75+ , "[2] The second note."
76+ , ""
77+ , "A second paragraph."
78+ , "</quote>"
79+ , ""
80+ , "* Second Header"
81+ , ""
82+ , "Some more text."
83+ ]
8384 , test (museWithOpts defopts {writerReferenceLocation=EndOfSection})
8485 "footnotes at the end of section" $
8586 noteLocationTestDoc =?>
86− (unlines [ "* First Header"
87− , ""
88− , "This is a footnote.[1]"
89− , ""
90− , "<quote>"
91− , "A note inside a block quote.[2]"
92− , ""
93− , "A second paragraph."
94− , "</quote>"
95− , ""
96− , "[1] First note."
97− , ""
98− , "[2] The second note."
99− , ""
100− , "* Second Header"
101− , ""
102− , "Some more text."
103− ])
87+ unlines [ "* First Header"
88+ , ""
89+ , "This is a footnote.[1]"
90+ , ""
91+ , "<quote>"
92+ , "A note inside a block quote.[2]"
93+ , ""
94+ , "A second paragraph."
95+ , "</quote>"
96+ , ""
97+ , "[1] First note."
98+ , ""
99+ , "[2] The second note."
100+ , ""
101+ , "* Second Header"
102+ , ""
103+ , "Some more text."
104+ ]
104105 ]
105106
106107tests :: [TestTree]
107108tests = [ testGroup "block elements"
108− [ "plain" =: plain (text "Foo bar.") =?> "Foo bar."
109+ [ "plain" =: plain "Foo bar." =?> "Foo bar."
109110 , testGroup "paragraphs"
110− [ "single paragraph" =: para (text "Sample paragraph.")
111+ [ "single paragraph" =: para "Sample paragraph."
111112 =?> "Sample paragraph."
112− , "two paragraphs" =: para (text "First paragraph.") <>
113− para (text "Second paragraph.")
113+ , "two paragraphs" =: para "First paragraph." <>
114+ para "Second paragraph."
114115 =?> unlines [ "First paragraph."
115116 , ""
116117 , "Second paragraph."
117118 ]
118119 ]
119− , "line block" =: lineBlock [text "Foo", text "bar", text "baz"]
120+ , "line block" =: lineBlock ["Foo", "bar", "baz"]
120121 =?> unlines [ "> Foo"
121122 , "> bar"
122123 , "> baz"
@@ -133,7 +134,7 @@ tests = [ testGroup "block elements"
133134 , "<hr>"
134135 , "</literal>"
135136 ]
136− , "block quote" =: blockQuote (para (text "Foo"))
137+ , "block quote" =: blockQuote (para "Foo")
137138 =?> unlines [ "<quote>"
138139 , "Foo"
139140 , "</quote>"
@@ -141,9 +142,9 @@ tests = [ testGroup "block elements"
141142 , testGroup "lists"
142143 [ testGroup "simple lists"
143144 [
144− "ordered list" =: orderedList [ plain $ text "first"
145− , plain $ text "second"
146− , plain $ text "third"
145+ "ordered list" =: orderedList [ plain "first"
146+ , plain "second"
147+ , plain "third"
147148 ]
148149 =?> unlines [ " 1. first"
149150 , " 2. second"
@@ -151,61 +152,62 @@ tests = [ testGroup "block elements"
151152 ]
152153 , "ordered list with Roman numerals"
153154 =: orderedListWith (1, UpperRoman, DefaultDelim)
154− [ plain $ text "first"
155− , plain $ text "second"
156− , plain $ text "third"
155+ [ plain "first"
156+ , plain "second"
157+ , plain "third"
157158 ]
158159 =?> unlines [ " I. first"
159160 , " II. second"
160161 , " III. third"
161162 ]
162− , "bullet list" =: bulletList [ plain $ text "first"
163− , plain $ text "second"
164− , plain $ text "third"
163+ , "bullet list" =: bulletList [ plain "first"
164+ , plain "second"
165+ , plain "third"
165166 ]
166167 =?> unlines [ " - first"
167168 , " - second"
168169 , " - third"
169170 ]
170− , "definition list" =: definitionList [ (text "first definition", [plain $ text "first description"])
171− , (text "second definition", [plain $ text "second description"])
172− , (text "third definition", [plain $ text "third description"])
171+ , "definition list" =: definitionList [ ("first definition", [plain "first description"])
172+ , ("second definition", [plain "second description"])
173+ , ("third definition", [plain "third description"])
173174 ]
174175 =?> unlines [ " first definition :: first description"
175176 , " second definition :: second description"
176177 , " third definition :: third description"
177178 ]
178179 , "definition list with multiple descriptions" =:
179− definitionList [ (text "first definition", [plain $ text "first description"
180− ,plain $ text "second description"])
181− , (text "second definition", [plain $ text "third description"])
180+ definitionList [ ("first definition", [ plain "first description"
181+ , plain "second description"
182+ ])
183+ , ("second definition", [plain "third description"])
182184 ]
183185 =?> unlines [ " first definition :: first description"
184186 , " :: second description"
185187 , " second definition :: third description"
186188 ]
187189 , "definition list with empty term" =:
188− definitionList [ (text "first definition", [plain $ text "first description"])
189− , (mempty, [plain $ text "second description"])
190− , (str "", [plain $ text "third description"])
190+ definitionList [ ("first definition", [plain "first description"])
191+ , (mempty, [plain "second description"])
192+ , (str "", [plain "third description"])
191193 ]
192194 =?> unlines [ " first definition :: first description"
193195 , " <verbatim></verbatim> :: second description"
194196 , " <verbatim></verbatim> :: third description"
195197 ]
196198 , "definition list terms starting with space" =:
197− definitionList [ (text "first definition", [plain $ text "first description"])
198− , (space <> str "foo", [plain $ text "second description"])
199− , (str " > bar", [plain $ text "third description"])
199+ definitionList [ ("first definition", [plain "first description"])
200+ , (space <> str "foo", [plain "second description"])
201+ , (str " > bar", [plain "third description"])
200202 ]
201203 =?> unlines [ " first definition :: first description"
202204 , " <verbatim></verbatim> foo :: second description"
203205 , " <verbatim></verbatim> > bar :: third description"
204206 ]
205207 , "definition list terms starting with list markers" =:
206− definitionList [ (text "first definition", [plain $ text "first description"])
207− , (str "-", [plain $ text "second description"])
208− , (str "1.", [plain $ text "third description"])
208+ definitionList [ ("first definition", [plain "first description"])
209+ , (str "-", [plain "second description"])
210+ , (str "1.", [plain "third description"])
209211 ]
210212 =?> unlines [ " first definition :: first description"
211213 , " <verbatim></verbatim>- :: second description"
@@ -215,12 +217,12 @@ tests = [ testGroup "block elements"
215217 -- Test that lists of the same type and style are separated with two blanklines
216218 , testGroup "sequential lists"
217219 [ "bullet lists" =:
218− bulletList [ para $ text "First"
219− , para $ text "Second"
220− , para $ text "Third"
220+ bulletList [ para "First"
221+ , para "Second"
222+ , para "Third"
221223 ] <>
222− bulletList [ para $ text "Fourth"
223− , para $ text "Fifth"
224+ bulletList [ para "Fourth"
225+ , para "Fifth"
224226 ] =?>
225227 unlines [ " - First"
226228 , " - Second"
@@ -231,11 +233,11 @@ tests = [ testGroup "block elements"
231233 , " - Fifth"
232234 ]
233235 , "ordered lists of the same style" =:
234− orderedListWith (1, UpperRoman, DefaultDelim) [ para $ text "First"
235− , para $ text "Second"
236+ orderedListWith (1, UpperRoman, DefaultDelim) [ para "First"
237+ , para "Second"
236238 ] <>
237− orderedListWith (1, UpperRoman, DefaultDelim) [ para $ text "Third"
238− , para $ text "Fourth"
239+ orderedListWith (1, UpperRoman, DefaultDelim) [ para "Third"
240+ , para "Fourth"
239241 ] =?>
240242 unlines [ " I. First"
241243 , " II. Second"
@@ -245,11 +247,11 @@ tests = [ testGroup "block elements"
245247 , " II. Fourth"
246248 ]
247249 , "ordered lists with equal styles" =:
248− orderedList [ para $ text "First"
249− , para $ text "Second"
250+ orderedList [ para "First"
251+ , para "Second"
250252 ] <>
251− orderedListWith (1, Decimal, DefaultDelim) [ para $ text "Third"
252− , para $ text "Fourth"
253+ orderedListWith (1, Decimal, DefaultDelim) [ para "Third"
254+ , para "Fourth"
253255 ] =?>
254256 unlines [ " 1. First"
255257 , " 2. Second"
@@ -259,11 +261,11 @@ tests = [ testGroup "block elements"
259261 , " 2. Fourth"
260262 ]
261263 , "bullet and ordered lists" =:
262− bulletList [ para $ text "First"
263− , para $ text "Second"
264+ bulletList [ para "First"
265+ , para "Second"
264266 ] <>
265− orderedListWith (1, UpperRoman, DefaultDelim) [ para $ text "Third"
266− , para $ text "Fourth"
267+ orderedListWith (1, UpperRoman, DefaultDelim) [ para "Third"
268+ , para "Fourth"
267269 ] =?>
268270 unlines [ " - First"
269271 , " - Second"
@@ -272,11 +274,11 @@ tests = [ testGroup "block elements"
272274 , " II. Fourth"
273275 ]
274276 , "different style ordered lists" =:
275− orderedListWith (1, UpperRoman, DefaultDelim) [ para $ text "First"
276− , para $ text "Second"
277+ orderedListWith (1, UpperRoman, DefaultDelim) [ para "First"
278+ , para "Second"
277279 ] <>
278− orderedListWith (1, Decimal, DefaultDelim) [ para $ text "Third"
279− , para $ text "Fourth"
280+ orderedListWith (1, Decimal, DefaultDelim) [ para "Third"
281+ , para "Fourth"
280282 ] =?>
281283 unlines [ " I. First"
282284 , " II. Second"
@@ -286,12 +288,12 @@ tests = [ testGroup "block elements"
286288 ]
287289 ]
288290 , testGroup "nested lists"
289− [ "nested ordered list" =: orderedList [ plain $ text "First outer"
290− , plain (text "Second outer:") <>
291− orderedList [ plain $ text "first"
292− , plain $ text "second"
291+ [ "nested ordered list" =: orderedList [ plain "First outer"
292+ , plain "Second outer:" <>
293+ orderedList [ plain "first"
294+ , plain "second"
293295 ]
294− , plain $ text "Third outer"
296+ , plain "Third outer"
295297 ]
296298 =?> unlines [ " 1. First outer"
297299 , " 2. Second outer:"
@@ -299,12 +301,12 @@ tests = [ testGroup "block elements"
299301 , " 2. second"
300302 , " 3. Third outer"
301303 ]
302− , "nested bullet lists" =: bulletList [ plain $ text "First outer"
303− , plain (text "Second outer:") <>
304− bulletList [ plain $ text "first"
305− , plain $ text "second"
304+ , "nested bullet lists" =: bulletList [ plain "First outer"
305+ , plain "Second outer:" <>
306+ bulletList [ plain "first"
307+ , plain "second"
306308 ]
307− , plain $ text "Third outer"
309+ , plain "Third outer"
308310 ]
309311 =?> unlines [ " - First outer"
310312 , " - Second outer:"
@@ -312,13 +314,13 @@ tests = [ testGroup "block elements"
312314 , " - second"
313315 , " - Third outer"
314316 ]
315− , "nested definition lists" =: definitionList [ (text "first definition", [plain $ text "first description"])
316− , (text "second definition",
317− [ plain (text "second description") <>
318− definitionList [ ( text "first inner definition"
319− , [plain $ text "first inner description"])
320− , ( text "second inner definition"
321− , [plain $ text "second inner description"])
317+ , "nested definition lists" =: definitionList [ ("first definition", [plain "first description"])
318+ , ("second definition",
319+ [ plain "second description" <>
320+ definitionList [ ("first inner definition"
321+ , [plain "first inner description"])
322+ , ( "second inner definition"
323+ , [plain "second inner description"])
322324 ]
323325 ]
324326 )
@@ -328,12 +330,12 @@ tests = [ testGroup "block elements"
328330 , " first inner definition :: first inner description"
329331 , " second inner definition :: second inner description"
330332 ]
331− , "list item starting with list" =: bulletList [ bulletList [ plain $ text "foo"] ] =?> " - - foo"
333+ , "list item starting with list" =: bulletList [ bulletList [ plain "foo"] ] =?> " - - foo"
332334 ]
333335 -- Check that list is intended with one space even inside a quote
334− , "List inside block quote" =: blockQuote (orderedList [ plain $ text "first"
335− , plain $ text "second"
336− , plain $ text "third"
336+ , "List inside block quote" =: blockQuote (orderedList [ plain "first"
337+ , plain "second"
338+ , plain "third"
337339 ])
338340 =?> unlines [ "<quote>"
339341 , " 1. first"
@@ -344,32 +346,32 @@ tests = [ testGroup "block elements"
344346 ]
345347 , testGroup "headings"
346348 [ "normal heading" =:
347− header 1 (text "foo") =?> "* foo"
349+ header 1 "foo" =?> "* foo"
348350 , "heading levels" =:
349− header 1 (text "First level") <>
350− header 3 (text "Third level") =?>
351+ header 1 "First level" <>
352+ header 3 "Third level" =?>
351353 unlines [ "* First level"
352354 , ""
353355 , "*** Third level"
354356 ]
355357 , "heading with ID" =:
356− headerWith ("bar", [], []) 2 (text "Foo") =?>
358+ headerWith ("bar", [], []) 2 "Foo" =?>
357359 unlines [ "#bar"
358360 , "** Foo"
359361 ]
360362 , "empty heading" =: header 4 mempty =?> "**** <verbatim></verbatim>"
361363 ]
362364 , "horizontal rule" =: horizontalRule =?> "----"
363− , "escape horizontal rule" =: para (text "----") =?> "<verbatim></verbatim>----"
364− , "escape long horizontal rule" =: para (text "----------") =?> "<verbatim></verbatim>----------"
365− , "don't escape horizontal inside paragraph" =: para (text "foo ---- bar") =?> "foo ---- bar"
366− , "escape nonbreaking space" =: para (text "~~") =?> "<verbatim>~~</verbatim>"
367− , "escape > in the beginning of line" =: para (text "> foo bar") =?> "<verbatim></verbatim>> foo bar"
365+ , "escape horizontal rule" =: para "----" =?> "<verbatim></verbatim>----"
366+ , "escape long horizontal rule" =: para "----------" =?> "<verbatim></verbatim>----------"
367+ , "don't escape horizontal inside paragraph" =: para "foo ---- bar" =?> "foo ---- bar"
368+ , "escape nonbreaking space" =: para "~~" =?> "<verbatim>~~</verbatim>"
369+ , "escape > in the beginning of line" =: para "> foo bar" =?> "<verbatim></verbatim>> foo bar"
368370 , "escape string with > and space in the beginning of line" =: para (str "> foo bar") =?> "<verbatim></verbatim>> foo bar"
369371 , testGroup "tables"
370372 [ "table without header" =:
371− let rows = [[para $ text "Para 1.1", para $ text "Para 1.2"]
372− ,[para $ text "Para 2.1", para $ text "Para 2.2"]]
373+ let rows = [[para "Para 1.1", para "Para 1.2"]
374+ ,[para "Para 2.1", para "Para 2.2"]]
373375 in table mempty [(AlignDefault,0.0),(AlignDefault,0.0)]
374376 [mempty, mempty] rows
375377 =?>
@@ -377,9 +379,9 @@ tests = [ testGroup "block elements"
377379 , " Para 2.1 | Para 2.2"
378380 ]
379381 , "table with header" =:
380− let headers = [plain $ text "header 1", plain $ text "header 2"]
381− rows = [[para $ text "Para 1.1", para $ text "Para 1.2"]
382− ,[para $ text "Para 2.1", para $ text "Para 2.2"]]
382+ let headers = [plain "header 1", plain "header 2"]
383+ rows = [[para "Para 1.1", para "Para 1.2"]
384+ ,[para "Para 2.1", para "Para 2.2"]]
383385 in simpleTable headers rows
384386 =?>
385387 unlines [ " header 1 || header 2"
@@ -387,10 +389,10 @@ tests = [ testGroup "block elements"
387389 , " Para 2.1 | Para 2.2"
388390 ]
389391 , "table with header and caption" =:
390− let caption = text "Table 1"
391− headers = [plain $ text "header 1", plain $ text "header 2"]
392− rows = [[para $ text "Para 1.1", para $ text "Para 1.2"]
393− ,[para $ text "Para 2.1", para $ text "Para 2.2"]]
392+ let caption = "Table 1"
393+ headers = [plain "header 1", plain "header 2"]
394+ rows = [[para "Para 1.1", para "Para 1.2"]
395+ ,[para "Para 2.1", para "Para 2.2"]]
394396 in table caption [(AlignDefault,0.0),(AlignDefault,0.0)]
395397 headers rows
396398 =?> unlines [ " header 1 || header 2"
@@ -400,7 +402,7 @@ tests = [ testGroup "block elements"
400402 ]
401403 ]
402404 , "div with bullet list" =:
403− divWith nullAttr (bulletList [para $ text "foo"]) =?>
405+ divWith nullAttr (bulletList [para "foo"]) =?>
404406 unlines [ " - foo" ] -- Making sure bullets are indented
405407 -- Null is trivial
406408 ]
@@ -424,8 +426,8 @@ tests = [ testGroup "block elements"
424426 , "do not escape colon" =: str ":" =?> ":"
425427 , "escape - to avoid accidental unordered lists" =: text " - foo" =?> "<verbatim></verbatim> - foo"
426428 , "escape - inside a list to avoid accidental nested unordered lists" =:
427− bulletList [ para (text "foo") <>
428− para (text "- bar")
429+ bulletList [ para "foo" <>
430+ para "- bar"
429431 ] =?>
430432 unlines [ " - foo"
431433 , ""
@@ -440,7 +442,7 @@ tests = [ testGroup "block elements"
440442 , " <verbatim></verbatim>- bar"
441443 ]
442444 , "escape - inside a note" =:
443− note (para (text "- foo")) =?>
445+ note (para "- foo") =?>
444446 unlines [ "[1]"
445447 , ""
446448 , "[1] <verbatim></verbatim>- foo"
@@ -454,16 +456,16 @@ tests = [ testGroup "block elements"
454456 ]
455457 , "escape ; to avoid accidental comments" =: text "; foo" =?> "<verbatim></verbatim>; foo"
456458 , "escape strings starting with ; and space" =: str "; foo" =?> "<verbatim></verbatim>; foo"
457− , "escape ; after softbreak" =: text "foo" <> softbreak <> text "; bar" =?> "foo\n<verbatim></verbatim>; bar"
458− , "escape ; after linebreak" =: text "foo" <> linebreak <> text "; bar" =?> "foo<br>\n<verbatim></verbatim>; bar"
459+ , "escape ; after softbreak" =: "foo" <> softbreak <> "; bar" =?> "foo\n<verbatim></verbatim>; bar"
460+ , "escape ; after linebreak" =: "foo" <> linebreak <> "; bar" =?> "foo<br>\n<verbatim></verbatim>; bar"
459461 , "do not escape ; inside paragraph" =: text "foo ; bar" =?> "foo ; bar"
460462 , "escape newlines" =: str "foo\nbar" =?> "foo bar"
461463 ]
462464 , testGroup "emphasis"
463− [ "emphasis" =: emph (text "foo") =?> "*foo*"
464− , "emphasis inside word" =: text "foo" <> emph (text "bar") <> text "baz" =?> "foo<em>bar</em>baz"
465− , "emphasis before comma" =: emph (text "foo") <> text ", bar" =?> "*foo*, bar"
466− , "emphasis before period" =: emph (text "foobar") <> text "." =?> "*foobar*."
465+ [ "emphasis" =: emph "foo" =?> "*foo*"
466+ , "emphasis inside word" =: "foo" <> emph "bar" <> "baz" =?> "foo<em>bar</em>baz"
467+ , "emphasis before comma" =: emph "foo" <> ", bar" =?> "*foo*, bar"
468+ , "emphasis before period" =: emph "foobar" <> "." =?> "*foobar*."
467469 , "empty emphasis" =: emph mempty =?> "<em></em>"
468470 , "empty strong" =: strong mempty =?> "<strong></strong>"
469471 , "empty strong emphasis" =: strong (emph mempty) =?> "**<em></em>**"
@@ -476,31 +478,31 @@ tests = [ testGroup "block elements"
476478 , "emphasized string ending with space" =: emph (str "foo ") =?> "<em>foo </em>"
477479 , "emphasized string with tab" =: emph (str "\t") =?> "<em>\t</em>"
478480 , "emphasized space between empty strings" =: emph (str "" <> space <> str "") =?> "<em> </em>"
479− , "strong" =: strong (text "foo") =?> "**foo**"
480− , "strong inside word" =: text "foo" <> strong (text "bar") <> text "baz" =?> "foo<strong>bar</strong>baz"
481− , "strong emphasis" =: strong (emph (text "foo")) =?> "***foo***"
482− , "strong after emphasis" =: emph (text "foo") <> strong (text "bar") =?> "*foo*<strong>bar</strong>"
483− , "strong emphasis after emphasis" =: emph (text "foo") <> strong (emph (text "bar")) =?> "*foo*<strong>*bar*</strong>"
484− , "strong in the end of emphasis" =: emph (text "foo" <> strong (text "bar")) =?> "*foo<strong>bar</strong>*"
481+ , "strong" =: strong "foo" =?> "**foo**"
482+ , "strong inside word" =: "foo" <> strong "bar" <> "baz" =?> "foo<strong>bar</strong>baz"
483+ , "strong emphasis" =: strong (emph "foo") =?> "***foo***"
484+ , "strong after emphasis" =: emph "foo" <> strong "bar" =?> "*foo*<strong>bar</strong>"
485+ , "strong emphasis after emphasis" =: emph "foo" <> strong (emph "bar") =?> "*foo*<strong>*bar*</strong>"
486+ , "strong in the end of emphasis" =: emph ("foo" <> strong "bar") =?> "*foo<strong>bar</strong>*"
485487 , "switch to lightweight markup after <em> tag" =:
486488 strong (str "foo") <> emph (str "bar") <> strong (str "baz") =?>
487489 "**foo**<em>bar</em>**baz**"
488− , "strikeout" =: strikeout (text "foo") =?> "<del>foo</del>"
489− , "space at the beginning of emphasis" =: emph (text " foo") =?> "<em> foo</em>"
490− , "space at the end of emphasis" =: emph (text "foo ") =?> "<em>foo </em>"
491− , "space at the beginning of strong" =: strong (text " foo") =?> "<strong> foo</strong>"
492− , "space at the end of strong" =: strong (text "foo ") =?> "<strong>foo </strong>"
493− , "space at the beginning of strong emphasis" =: strong (emph (text " foo")) =?> "**<em> foo</em>**"
494− , "space at the end of strong emphasis" =: strong (emph (text "foo ")) =?> "**<em>foo </em>**"
495− , "space at the beginning of emphasiszed strong" =: emph (strong (text " foo")) =?> "*<strong> foo</strong>*"
496− , "space at the end of emphasized strong" =: emph (strong (text "foo ")) =?> "*<strong>foo </strong>*"
490+ , "strikeout" =: strikeout "foo" =?> "<del>foo</del>"
491+ , "space at the beginning of emphasis" =: emph " foo" =?> "<em> foo</em>"
492+ , "space at the end of emphasis" =: emph "foo " =?> "<em>foo </em>"
493+ , "space at the beginning of strong" =: strong " foo" =?> "<strong> foo</strong>"
494+ , "space at the end of strong" =: strong "foo " =?> "<strong>foo </strong>"
495+ , "space at the beginning of strong emphasis" =: strong (emph " foo") =?> "**<em> foo</em>**"
496+ , "space at the end of strong emphasis" =: strong (emph "foo ") =?> "**<em>foo </em>**"
497+ , "space at the beginning of emphasiszed strong" =: emph (strong " foo") =?> "*<strong> foo</strong>*"
498+ , "space at the end of emphasized strong" =: emph (strong "foo ") =?> "*<strong>foo </strong>*"
497499 ]
498− , "superscript" =: superscript (text "foo") =?> "<sup>foo</sup>"
499− , "subscript" =: subscript (text "foo") =?> "<sub>foo</sub>"
500− , "smallcaps" =: smallcaps (text "foo") =?> "*foo*"
500+ , "superscript" =: superscript "foo" =?> "<sup>foo</sup>"
501+ , "subscript" =: subscript "foo" =?> "<sub>foo</sub>"
502+ , "smallcaps" =: smallcaps "foo" =?> "*foo*"
501503 , "smallcaps near emphasis" =: emph (str "foo") <> smallcaps (str "bar") =?> "*foobar*"
502− , "single quoted" =: singleQuoted (text "foo") =?> "‘foo’"
503− , "double quoted" =: doubleQuoted (text "foo") =?> "“foo”"
504+ , "single quoted" =: singleQuoted "foo" =?> "‘foo’"
505+ , "double quoted" =: doubleQuoted "foo" =?> "“foo”"
504506 -- Cite is trivial
505507 , testGroup "code"
506508 [ "simple" =: code "foo" =?> "=foo="
@@ -518,21 +520,21 @@ tests = [ testGroup "block elements"
518520 , "strong code" =: strong (code "foo") =?> "**=foo=**"
519521 ]
520522 , testGroup "spaces"
521− [ "space" =: text "a" <> space <> text "b" =?> "a b"
522− , "soft break" =: text "a" <> softbreak <> text "b" =?> "a\nb"
523+ [ "space" =: "a" <> space <> "b" =?> "a b"
524+ , "soft break" =: "a" <> softbreak <> "b" =?> "a\nb"
523525 , test (museWithOpts def{ writerWrapText = WrapNone })
524− "remove soft break" $ text "a" <> softbreak <> text "b"
525− =?> "a b"
526− , "line break" =: text "a" <> linebreak <> text "b" =?> "a<br>\nb"
527− , "no newline after line break in header" =: header 1 (text "a" <> linebreak <> text "b") =?> "* a<br>b"
528− , "no softbreak in header" =: header 1 (text "a" <> softbreak <> text "b") =?> "* a b"
526+ "remove soft break" $ "a" <> softbreak <> "b"
527+ =?> ("a b" :: String)
528+ , "line break" =: "a" <> linebreak <> "b" =?> "a<br>\nb"
529+ , "no newline after line break in header" =: header 1 ("a" <> linebreak <> "b") =?> "* a<br>b"
530+ , "no softbreak in header" =: header 1 ("a" <> softbreak <> "b") =?> "* a b"
529531 ]
530532 , testGroup "math"
531533 [ "inline math" =: math "2^3" =?> "2<sup>3</sup>"
532534 , "display math" =: displayMath "2^3" =?> "2<sup>3</sup>"
533535 , "multiple letters in inline math" =: math "abc" =?> "*abc*"
534536 , "expand math before normalization" =: math "[" <> str "2]" =?> "<verbatim>[2]</verbatim>"
535− , "multiple math expressions inside one inline list" =: math "5_4" <> text ", " <> displayMath "3^2" =?> "5<sub>4</sub>, 3<sup>2</sup>"
537+ , "multiple math expressions inside one inline list" =: math "5_4" <> ", " <> displayMath "3^2" =?> "5<sub>4</sub>, 3<sup>2</sup>"
536538 ]
537539 , "raw inline"
538540 =: rawInline "html" "<mark>marked text</mark>"
@@ -577,45 +579,45 @@ tests = [ testGroup "block elements"
577579 imageWith ("", ["align-right"], [("width", "60%")]) "image.png" "Image" (str "") =?>
578580 "[[image.png 60 r][Image]]"
579581 , "escape brackets in image title" =: image "image.png" "Foo]bar" (str "") =?> "[[image.png][<verbatim>Foo]bar</verbatim>]]"
580− , "note" =: note (plain (text "Foo"))
582+ , "note" =: note (plain "Foo")
581583 =?> unlines [ "[1]"
582584 , ""
583585 , "[1] Foo"
584586 ]
585587 , noteLocationTests
586− , "span with class" =: spanWith ("",["foobar"],[]) (text "Some text")
588+ , "span with class" =: spanWith ("",["foobar"],[]) "Some text"
587589 =?> "<class name=\"foobar\">Some text</class>"
588− , "span without class" =: spanWith ("",[],[]) (text "Some text")
590+ , "span without class" =: spanWith ("",[],[]) "Some text"
589591 =?> "<class>Some text</class>"
590− , "span with anchor" =: spanWith ("anchor", [], []) mempty <> text "Foo bar"
592+ , "span with anchor" =: spanWith ("anchor", [], []) mempty <> "Foo bar"
591593 =?> "#anchor Foo bar"
592594 , "empty span with anchor" =: spanWith ("anchor", [], []) mempty
593595 =?> "#anchor"
594596 , "empty span without class and anchor" =: spanWith ("", [], []) mempty
595597 =?> "<class></class>"
596− , "span with class and anchor" =: spanWith ("anchor", ["foo"], []) (text "bar")
598+ , "span with class and anchor" =: spanWith ("anchor", ["foo"], []) "bar"
597599 =?> "#anchor <class name=\"foo\">bar</class>"
598600 , "adjacent spans" =: spanWith ("", ["syllable"], []) (str "wa") <>
599601 spanWith ("", ["syllable"], []) (str "ter")
600602 =?> "<class name=\"syllable\">wa</class><class name=\"syllable\">ter</class>"
601603 , testGroup "combined"
602604 [ "emph word before" =:
603− para (text "foo" <> emph (text "bar")) =?>
605+ para ("foo" <> emph "bar") =?>
604606 "foo<em>bar</em>"
605607 , "emph word after" =:
606− para (emph (text "foo") <> text "bar") =?>
608+ para (emph "foo" <> "bar") =?>
607609 "<em>foo</em>bar"
608610 , "emph quoted" =:
609− para (doubleQuoted (emph (text "foo"))) =?>
611+ para (doubleQuoted (emph "foo")) =?>
610612 "“*foo*”"
611613 , "strong word before" =:
612− para (text "foo" <> strong (text "bar")) =?>
614+ para ("foo" <> strong "bar") =?>
613615 "foo<strong>bar</strong>"
614616 , "strong word after" =:
615− para (strong (text "foo") <> text "bar") =?>
617+ para (strong "foo" <> "bar") =?>
616618 "<strong>foo</strong>bar"
617619 , "strong quoted" =:
618− para (singleQuoted (strong (text "foo"))) =?>
620+ para (singleQuoted (strong "foo")) =?>
619621 "‘**foo**’"
620622 ]
621623 ]