summaryrefslogtreecommitdiff
path: root/tests/Tests/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-12 12:21:36 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-12 12:58:31 -0800
commitd6a4c70ef8c9a8f19a123a10e9570af66831180e (patch)
tree5790a7c5a0e534528da4346645a3feafd516ed39 /tests/Tests/Readers
parentaf7e78243682ec7c353dd202590c45c734f86ada (diff)
Test fixes.
Diffstat (limited to 'tests/Tests/Readers')
-rw-r--r--tests/Tests/Readers/Org.hs40
-rw-r--r--tests/Tests/Readers/RST.hs5
-rw-r--r--tests/Tests/Readers/Txt2Tags.hs6
3 files changed, 26 insertions, 25 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 9e7399aa0..2bde26f0f 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -109,10 +109,9 @@ tests =
, "seven*eight* nine*"
, "+not+funny+"
] =?>
- para (spcSep [ "this+that+", "+so+on"
- , "seven*eight*", "nine*"
- , strikeout "not+funny"
- ])
+ para ("this+that+ +so+on" <> softbreak <>
+ "seven*eight* nine*" <> softbreak <>
+ strikeout "not+funny")
, "No empty markup" =:
"// ** __ ++ == ~~ $$" =?>
@@ -142,8 +141,9 @@ tests =
, "Inline math must stay within three lines" =:
unlines [ "$a", "b", "c$", "$d", "e", "f", "g$" ] =?>
- para ((math "a\nb\nc") <> space <>
- spcSep [ "$d", "e", "f", "g$" ])
+ para ((math "a\nb\nc") <> softbreak <>
+ "$d" <> softbreak <> "e" <> softbreak <>
+ "f" <> softbreak <> "g$")
, "Single-character math" =:
"$a$ $b$! $c$?" =?>
@@ -153,14 +153,13 @@ tests =
])
, "Markup may not span more than two lines" =:
- unlines [ "/this *is +totally", "nice+ not*", "emph/" ] =?>
- para (spcSep [ "/this"
- , (strong (spcSep
- [ "is"
- , (strikeout ("totally" <> space <> "nice"))
- , "not"
- ]))
- , "emph/" ])
+ "/this *is +totally\nnice+ not*\nemph/" =?>
+ para ("/this" <> space <>
+ strong ("is" <> space <>
+ strikeout ("totally" <>
+ softbreak <> "nice") <>
+ space <> "not") <>
+ softbreak <> "emph/")
, "Sub- and superscript expressions" =:
unlines [ "a_(a(b)(c)d)"
@@ -174,7 +173,8 @@ tests =
, "3_{{}}"
, "4^(a(*b(c*)d))"
] =?>
- para (spcSep [ "a" <> subscript "(a(b)(c)d)"
+ para (mconcat $ intersperse softbreak
+ [ "a" <> subscript "(a(b)(c)d)"
, "e" <> superscript "(f(g)h)"
, "i" <> (subscript "(jk)") <> "l)"
, "m" <> (superscript "()") <> "n"
@@ -404,13 +404,13 @@ tests =
unlines [ " :LOGBOOK: foo"
, " :END:"
] =?>
- para (spcSep [ ":LOGBOOK:", "foo", ":END:" ])
+ para (":LOGBOOK:" <> space <> "foo" <> softbreak <> ":END:")
, "Drawers with unknown names are just text" =:
unlines [ ":FOO:"
, ":END:"
] =?>
- para (":FOO:" <> space <> ":END:")
+ para (":FOO:" <> softbreak <> ":END:")
, "Anchor reference" =:
unlines [ "<<link-here>> Target."
@@ -577,7 +577,7 @@ tests =
unlines [ "lucky"
, "*star"
] =?>
- para ("lucky" <> space <> "*star")
+ para ("lucky" <> softbreak <> "*star")
, "Example block" =:
unlines [ ": echo hello"
@@ -709,8 +709,8 @@ tests =
" Tony*\n" ++
"- /Sideshow\n" ++
" Bob/") =?>
- bulletList [ plain $ strong ("Fat" <> space <> "Tony")
- , plain $ emph ("Sideshow" <> space <> "Bob")
+ bulletList [ plain $ strong ("Fat" <> softbreak <> "Tony")
+ , plain $ emph ("Sideshow" <> softbreak <> "Bob")
]
, "Nested Bullet Lists" =:
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs
index df6ba61b2..ea85a5929 100644
--- a/tests/Tests/Readers/RST.hs
+++ b/tests/Tests/Readers/RST.hs
@@ -42,9 +42,9 @@ tests = [ "line block with blank line" =:
, (text "IP address", [para "10.0.0.19"])
, (str "Size", [para "3ru"])
, (str "Version", [para "1"])
- , (str "Indentation", [para "Since the field marker may be quite long, the second and subsequent lines of the field body do not have to line up with the first line, but they must be indented relative to the field name marker, and they must line up with each other."])
+ , (str "Indentation", [para "Since the field marker may be quite long, the second\nand subsequent lines of the field body do not have to line up\nwith the first line, but they must be indented relative to the\nfield name marker, and they must line up with each other."])
, (text "Parameter i", [para "integer"])
- , (str "Final", [para "item on two lines"])
+ , (str "Final", [para "item\non two lines"])
])
, "metadata" =: unlines
[ "====="
@@ -87,6 +87,7 @@ tests = [ "line block with blank line" =:
para (link "http://google.com" "" "http://google.com" <> ", " <>
link "http://yahoo.com" "" "http://yahoo.com" <> "; " <>
link "http://foo.bar.baz" "" "http://foo.bar.baz" <> ". " <>
+ softbreak <>
link "http://foo.bar/baz_(bam)" "" "http://foo.bar/baz_(bam)"
<> " (" <> link "http://foo.bar" "" "http://foo.bar" <> ")")
, "Reference names with special characters" =:
diff --git a/tests/Tests/Readers/Txt2Tags.hs b/tests/Tests/Readers/Txt2Tags.hs
index bfe217ce3..e0067c698 100644
--- a/tests/Tests/Readers/Txt2Tags.hs
+++ b/tests/Tests/Readers/Txt2Tags.hs
@@ -113,13 +113,13 @@ tests =
, testGroup "Basic Blocks" $
["Paragraph, lines grouped together" =:
"A paragraph\n A blank line ends the \n current paragraph\n"
- =?> para "A paragraph A blank line ends the current paragraph"
+ =?> para "A paragraph\n A blank line ends the\n current paragraph"
, "Paragraph, ignore leading and trailing spaces" =:
" Leading and trailing spaces are ignored. \n" =?>
para "Leading and trailing spaces are ignored."
, "Comment line in paragraph" =:
"A comment line can be placed inside a paragraph.\n% this comment will be ignored \nIt will not affect it.\n"
- =?> para "A comment line can be placed inside a paragraph. It will not affect it."
+ =?> para "A comment line can be placed inside a paragraph.\nIt will not affect it."
, "Paragraph" =:
"Paragraph\n" =?>
para "Paragraph"
@@ -167,7 +167,7 @@ tests =
unlines [ "lucky"
, "*star"
] =?>
- para ("lucky" <> space <> "*star")
+ para ("lucky" <> softbreak <> "*star")
, "Horizontal Rule" =:
unlines [ "before"