aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-10-13 08:46:44 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-10-13 08:46:44 +0200
commitc9460e7013d395f77f75a4eb6bde933ffc34b6b6 (patch)
tree995d6d9786efef38130962430bd76a6e9fb564f2 /tests
parent22cb9e3327ff4aea6109c048a185506e67f07ef1 (diff)
downloadpandoc-c9460e7013d395f77f75a4eb6bde933ffc34b6b6.tar.gz
Parse line-oriented markup as LineBlock
Markup-features focusing on lines as distinctive part of the markup are read into `LineBlock` elements. This currently means line blocks in reStructuredText and Markdown (the latter only if the `line_block` extension is enabled), the `linegroup`/`line` combination from the Docbook 5.1 working draft, and Org-mode `VERSE` blocks.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Org.hs17
-rw-r--r--tests/Tests/Readers/RST.hs5
-rw-r--r--tests/markdown-reader-more.native10
-rw-r--r--tests/rst-reader.native10
4 files changed, 25 insertions, 17 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index d4fedc797..49423bd11 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -1490,14 +1490,11 @@ tests =
mconcat
[ para $ spcSep [ "The", "first", "lines", "of"
, "Goethe's", emph "Faust" <> ":"]
- , para $ mconcat
- [ spcSep [ "Habe", "nun,", "ach!", "Philosophie," ]
- , linebreak
- , spcSep [ "Juristerei", "und", "Medizin," ]
- , linebreak
- , spcSep [ "Und", "leider", "auch", "Theologie!" ]
- , linebreak
- , spcSep [ "Durchaus", "studiert,", "mit", "heißem", "Bemühn." ]
+ , lineBlock
+ [ "Habe nun, ach! Philosophie,"
+ , "Juristerei und Medizin,"
+ , "Und leider auch Theologie!"
+ , "Durchaus studiert, mit heißem Bemühn."
]
]
@@ -1508,7 +1505,7 @@ tests =
, "bar"
, "#+END_VERSE"
] =?>
- para ("foo" <> linebreak <> linebreak <> "bar")
+ lineBlock [ "foo", mempty, "bar" ]
, "Verse block with varying indentation" =:
unlines [ "#+BEGIN_VERSE"
@@ -1516,7 +1513,7 @@ tests =
, "my old friend"
, "#+END_VERSE"
] =?>
- para ("\160\160hello darkness" <> linebreak <> "my old friend")
+ lineBlock [ "\160\160hello darkness", "my old friend" ]
, "Raw block LaTeX" =:
unlines [ "#+BEGIN_LaTeX"
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs
index 622f5e48b..e47432250 100644
--- a/tests/Tests/Readers/RST.hs
+++ b/tests/Tests/Readers/RST.hs
@@ -19,8 +19,7 @@ infix 4 =:
tests :: [Test]
tests = [ "line block with blank line" =:
- "| a\n|\n| b" =?> para (str "a") <>
- para (str "\160b")
+ "| a\n|\n| b" =?> lineBlock [ "a", mempty, "\160b" ]
, testGroup "field list"
[ "general" =: unlines
[ "para"
@@ -135,7 +134,7 @@ tests = [ "line block with blank line" =:
codeBlock "block quotes\n\ncan go on for many lines" <>
para "but must stop here")
, "line block with 3 lines" =: "| a\n| b\n| c"
- =?> para ("a" <> linebreak <> "b" <> linebreak <> "c")
+ =?> lineBlock ["a", "b", "c"]
, "quoted literal block using >" =: "::\n\n> quoted\n> block\n\nOrdinary paragraph"
=?> codeBlock "> quoted\n> block" <> para "Ordinary paragraph"
, "quoted literal block using | (not a line block)" =: "::\n\n| quoted\n| block\n\nOrdinary paragraph"
diff --git a/tests/markdown-reader-more.native b/tests/markdown-reader-more.native
index 136996068..9df6a068a 100644
--- a/tests/markdown-reader-more.native
+++ b/tests/markdown-reader-more.native
@@ -84,8 +84,14 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Author",S
,BlockQuote
[Header 2 ("foobar",["baz"],[("key","val")]) [Str "Header",Space,Str "attributes",Space,Str "inside",Space,Str "block",Space,Str "quote"]]
,Header 2 ("line-blocks",[],[]) [Str "Line",Space,Str "blocks"]
-,Para [Str "But",Space,Str "can",Space,Str "a",Space,Str "bee",Space,Str "be",Space,Str "said",Space,Str "to",Space,Str "be",LineBreak,Str "\160\160\160\160or",Space,Str "not",Space,Str "to",Space,Str "be",Space,Str "an",Space,Str "entire",Space,Str "bee,",LineBreak,Str "\160\160\160\160\160\160\160\160when",Space,Str "half",Space,Str "the",Space,Str "bee",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "bee,",LineBreak,Str "\160\160\160\160\160\160\160\160\160\160\160\160due",Space,Str "to",Space,Str "some",Space,Str "ancient",Space,Str "injury?"]
-,Para [Str "Continuation",Space,Str "line",LineBreak,Str "\160\160and",Space,Str "another"]
+,LineBlock
+ [[Str "But",Space,Str "can",Space,Str "a",Space,Str "bee",Space,Str "be",Space,Str "said",Space,Str "to",Space,Str "be"]
+ ,[Str "\160\160\160\160or",Space,Str "not",Space,Str "to",Space,Str "be",Space,Str "an",Space,Str "entire",Space,Str "bee,"]
+ ,[Str "\160\160\160\160\160\160\160\160when",Space,Str "half",Space,Str "the",Space,Str "bee",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "bee,"]
+ ,[Str "\160\160\160\160\160\160\160\160\160\160\160\160due",Space,Str "to",Space,Str "some",Space,Str "ancient",Space,Str "injury?"]
+ ,[]
+ ,[Str "Continuation",Space,Str "line"]
+ ,[Str "\160\160and",Space,Str "another"]]
,Header 2 ("grid-tables",[],[]) [Str "Grid",Space,Str "Tables"]
,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.2638888888888889,0.16666666666666666,0.18055555555555555]
[[Plain [Str "col",Space,Str "1"]]
diff --git a/tests/rst-reader.native b/tests/rst-reader.native
index d44fa5efb..4a3df7f24 100644
--- a/tests/rst-reader.native
+++ b/tests/rst-reader.native
@@ -230,8 +230,14 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
,Para [Str "Another",Space,Str "paragraph"]
,Para [Str "A",Space,Str "third",Space,Str "paragraph"]
,Header 1 ("line-blocks",[],[]) [Str "Line",Space,Str "blocks"]
-,Para [Str "But",Space,Str "can",Space,Str "a",Space,Str "bee",Space,Str "be",Space,Str "said",Space,Str "to",Space,Str "be",LineBreak,Str "\160\160\160\160or",Space,Str "not",Space,Str "to",Space,Str "be",Space,Str "an",Space,Str "entire",Space,Str "bee,",LineBreak,Str "\160\160\160\160\160\160\160\160when",Space,Str "half",Space,Str "the",Space,Str "bee",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "bee,",LineBreak,Str "\160\160\160\160\160\160\160\160\160\160\160\160due",Space,Str "to",Space,Str "some",Space,Str "ancient",Space,Str "injury?"]
-,Para [Str "Continuation",Space,Str "line",LineBreak,Str "\160\160and",Space,Str "another"]
+,LineBlock
+ [[Str "But",Space,Str "can",Space,Str "a",Space,Str "bee",Space,Str "be",Space,Str "said",Space,Str "to",Space,Str "be"]
+ ,[Str "\160\160\160\160or",Space,Str "not",Space,Str "to",Space,Str "be",Space,Str "an",Space,Str "entire",Space,Str "bee,"]
+ ,[Str "\160\160\160\160\160\160\160\160when",Space,Str "half",Space,Str "the",Space,Str "bee",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "bee,"]
+ ,[Str "\160\160\160\160\160\160\160\160\160\160\160\160due",Space,Str "to",Space,Str "some",Space,Str "ancient",Space,Str "injury?"]
+ ,[]
+ ,[Str "Continuation",Space,Str "line"]
+ ,[Str "\160\160and",Space,Str "another"]]
,Header 1 ("simple-tables",[],[]) [Str "Simple",Space,Str "Tables"]
,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
[[Plain [Str "col",Space,Str "1"]]