git.iko.soy/typeable/pandoc
on master help sign in
Tests.Readers.RST: Group field list tests
commit8577007d9b9643e1f4620d3d1ac1642973c89082 authorLars-Dominik Braun <lars@6xq.net> dateFri 3 Jul 2015, 16:40 (11 years ago) parentb2adf44
1 file changed+26−24
tests/Tests/Readers/RST.hs+26−24
tests/Tests/Readers/RST.hs+26−24
@@ -22,7 +22,8 @@ tests :: [Test]
2222tests = [ "line block with blank line" =:
2323 "| a\n|\n| b" =?> para (str "a") <>
2424 para (str "\160b")
25− , "field list" =: unlines
25+ , testGroup "field list"
26+ [ "general" =: unlines
2627 [ "para"
2728 , ""
2829 , ":Hostname: media08"
@@ -36,17 +37,17 @@ tests = [ "line block with blank line" =:
3637 , ":Parameter i: integer"
3738 , ":Final: item"
3839 , " on two lines" ]
39− =?> ( doc
40− $ para "para" <>
41− definitionList [ (str "Hostname", [para "media08"])
42− , (text "IP address", [para "10.0.0.19"])
43− , (str "Size", [para "3ru"])
44− , (str "Version", [para "1"])
45− , (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."])
46− , (text "Parameter i", [para "integer"])
47− , (str "Final", [para "item on two lines"])
48− ])
49− , "initial field list" =: unlines
40+ =?> ( doc
41+ $ para "para" <>
42+ definitionList [ (str "Hostname", [para "media08"])
43+ , (text "IP address", [para "10.0.0.19"])
44+ , (str "Size", [para "3ru"])
45+ , (str "Version", [para "1"])
46+ , (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."])
47+ , (text "Parameter i", [para "integer"])
48+ , (str "Final", [para "item on two lines"])
49+ ])
50+ , "metadata" =: unlines
5051 [ "====="
5152 , "Title"
5253 , "====="
@@ -56,11 +57,11 @@ tests = [ "line block with blank line" =:
5657 , ""
5758 , ":Version: 1"
5859 ]
59− =?> ( setMeta "version" (para "1")
60− $ setMeta "title" ("Title" :: Inlines)
61− $ setMeta "subtitle" ("Subtitle" :: Inlines)
62− $ doc mempty )
63− , "field list name with inline markup" =: unlines
60+ =?> ( setMeta "version" (para "1")
61+ $ setMeta "title" ("Title" :: Inlines)
62+ $ setMeta "subtitle" ("Subtitle" :: Inlines)
63+ $ doc mempty )
64+ , "with inline markup" =: unlines
6465 [ "the following field list is not metadata"
6566 , ""
6667 , ":*one*: emphasis"
@@ -71,13 +72,14 @@ tests = [ "line block with blank line" =:
7172 , ".. _two: http://example.com"
7273 , ".. _three: http://example.org"
7374 ]
74− =?> (doc
75− $ para "the following field list is not metadata" <>
76− definitionList [ (emph "one", [para "emphasis"])
77− , (link "http://example.com" "" "two", [para "reference"])
78− , (link "http://example.org" "" "three", [para "another one"])
79− , (code "four", [para "literal"])
80− ])
75+ =?> ( doc
76+ $ para "the following field list is not metadata" <>
77+ definitionList [ (emph "one", [para "emphasis"])
78+ , (link "http://example.com" "" "two", [para "reference"])
79+ , (link "http://example.org" "" "three", [para "another one"])
80+ , (code "four", [para "literal"])
81+ ])
82+ ]
8183 , "URLs with following punctuation" =:
8284 ("http://google.com, http://yahoo.com; http://foo.bar.baz.\n" ++
8385 "http://foo.bar/baz_(bam) (http://foo.bar)") =?>