aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Readers/LaTeX.hs23
-rw-r--r--test/Tests/Readers/Muse.hs64
-rw-r--r--test/Tests/Readers/RST.hs13
3 files changed, 95 insertions, 5 deletions
diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs
index b07eb875a..4effe26e8 100644
--- a/test/Tests/Readers/LaTeX.hs
+++ b/test/Tests/Readers/LaTeX.hs
@@ -143,6 +143,29 @@ tests = [ testGroup "basic"
"hello\\pfbreak*{}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
]
+ , testGroup "biblatex roman numerals"
+ [ "upper" =:
+ "number \\RN{12}" =?>
+ para (str "number" <> space <> str "XII")
+ , "lower" =:
+ "number \\Rn{29}" =?>
+ para (str "number" <> space <> str "xxix")
+ , "leading zero" =:
+ "\\Rn{014}" =?>
+ para (str "xiv")
+ , "surrounding spaces" =:
+ "number \\Rn{ 41 }" =?>
+ para (str "number" <> space <> str "xli")
+ , "zero" =:
+ "\\RN{0}" =?>
+ para (str "")
+ , "space then unbraced argument" =:
+ "\\RN 7 ok" =?>
+ para (str "VII" <> space <> str "ok")
+ , "space before braced argument" =:
+ "\\Rn {13}ok" =?>
+ para (str "xiiiok")
+ ]
]
baseCitation :: Citation
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 8d4ad0b15..dac167a92 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -145,8 +145,61 @@ tests =
, " with a continuation"
] =?>
blockQuote (para "This is a quotation with a continuation")
+ , testGroup "Div"
+ [ "Div without id" =:
+ "<div>Foo bar</div>" =?>
+ divWith nullAttr (para "Foo bar")
+ , "Div with id" =:
+ "<div id=\"foo\">Foo bar</div>" =?>
+ divWith ("foo", [], []) (para "Foo bar")
+ ]
+ , "Verse" =:
+ T.unlines [ "> This is"
+ , "> First stanza"
+ , ">" -- Emacs produces verbatim ">" here, we follow Amusewiki
+ , "> And this is"
+ , "> Second stanza"
+ , ">"
+ , ""
+ , ">"
+ , ""
+ , "> Another verse"
+ , "> is here"
+ ] =?>
+ lineBlock [ "This is"
+ , "First stanza"
+ , ""
+ , "And this is"
+ , "\160\160Second stanza"
+ , ""
+ ] <>
+ lineBlock [ "" ] <>
+ lineBlock [ "Another verse"
+ , "\160\160\160is here"
+ ]
]
, "Quote tag" =: "<quote>Hello, world</quote>" =?> blockQuote (para $ text "Hello, world")
+ , "Verse tag" =:
+ T.unlines [ "<verse>"
+ , ""
+ , "Foo bar baz"
+ , " One two three"
+ , ""
+ , "</verse>"
+ , "<verse>Foo bar</verse>"
+ , "<verse>"
+ , "Foo bar</verse>"
+ , "<verse>"
+ , " Foo</verse>"
+ ] =?>
+ lineBlock [ ""
+ , text "Foo bar baz"
+ , text "\160\160One two three"
+ , ""
+ ] <>
+ lineBlock [ "Foo bar" ] <>
+ lineBlock [ "Foo bar" ] <>
+ lineBlock [ "\160\160\160Foo" ]
, "Center" =: "<center>Hello, world</center>" =?> para (text "Hello, world")
, "Right" =: "<right>Hello, world</right>" =?> para (text "Hello, world")
, testGroup "Comments"
@@ -157,20 +210,21 @@ tests =
]
, testGroup "Headers"
[ "Part" =:
- "* First level\n" =?>
+ "* First level" =?>
header 1 "First level"
, "Chapter" =:
- "** Second level\n" =?>
+ "** Second level" =?>
header 2 "Second level"
, "Section" =:
- "*** Third level\n" =?>
+ "*** Third level" =?>
header 3 "Third level"
, "Subsection" =:
- "**** Fourth level\n" =?>
+ "**** Fourth level" =?>
header 4 "Fourth level"
, "Subsubsection" =:
- "***** Fifth level\n" =?>
+ "***** Fifth level" =?>
header 5 "Fifth level"
+ , "Whitespace is required after *" =: "**Not a header" =?> para "**Not a header"
, "No headers in footnotes" =:
T.unlines [ "Foo[1]"
, "[1] * Bar"
diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs
index 61a2673f5..928fc1a99 100644
--- a/test/Tests/Readers/RST.hs
+++ b/test/Tests/Readers/RST.hs
@@ -136,6 +136,19 @@ tests = [ "line block with blank line" =:
para "but must stop here")
, "line block with 3 lines" =: "| a\n| b\n| c"
=?> lineBlock ["a", "b", "c"]
+ , "line blocks with blank lines" =: T.unlines
+ [ "|"
+ , ""
+ , "|"
+ , "| a"
+ , "| b"
+ , "|"
+ , ""
+ , "|"
+ ] =?>
+ lineBlock [""] <>
+ lineBlock ["", "a", "b", ""] <>
+ lineBlock [""]
, "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"