Skip to content

Commit

Permalink
Test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Dec 12, 2015
1 parent af7e782 commit d6a4c70
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 237 deletions.
40 changes: 20 additions & 20 deletions tests/Tests/Readers/Org.hs
Expand Up @@ -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" =:
"// ** __ ++ == ~~ $$" =?>
Expand Down Expand Up @@ -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$?" =?>
Expand All @@ -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)"
Expand All @@ -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"
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -577,7 +577,7 @@ tests =
unlines [ "lucky"
, "*star"
] =?>
para ("lucky" <> space <> "*star")
para ("lucky" <> softbreak <> "*star")

, "Example block" =:
unlines [ ": echo hello"
Expand Down Expand Up @@ -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" =:
Expand Down
5 changes: 3 additions & 2 deletions tests/Tests/Readers/RST.hs
Expand Up @@ -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
[ "====="
Expand Down Expand Up @@ -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" =:
Expand Down
6 changes: 3 additions & 3 deletions tests/Tests/Readers/Txt2Tags.hs
Expand Up @@ -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"
Expand Down Expand Up @@ -167,7 +167,7 @@ tests =
unlines [ "lucky"
, "*star"
] =?>
para ("lucky" <> space <> "*star")
para ("lucky" <> softbreak <> "*star")

, "Horizontal Rule" =:
unlines [ "before"
Expand Down

0 comments on commit d6a4c70

Please sign in to comment.