@@ -7,6 +7,7 @@ import Tests.Helpers
77import Tests.Arbitrary()
88import Text.Pandoc.Builder
99import Text.Pandoc
10+import Data.Monoid (mempty)
1011
1112latex :: String -> Pandoc
1213latex = readLaTeX defaultParserState
@@ -35,10 +36,10 @@ tests = [ testGroup "basic"
3536 "\\subsubsection{header}" =?> header 3 "header"
3637 , "emph" =:
3738 "\\section{text \\emph{emph}}" =?>
38− header 1 ("text" +++ space +++ emph "emph")
39+ header 1 ("text" <> space <> emph "emph")
3940 , "link" =:
4041 "\\section{text \\href{/url}{link}}" =?>
41− header 1 ("text" +++ space +++ link "/url" "" "link")
42+ header 1 ("text" <> space <> link "/url" "" "link")
4243 ]
4344
4445 , testGroup "space and comments"
@@ -67,13 +68,13 @@ baseCitation = Citation{ citationId = "item1"
6768natbibCitations :: Test
6869natbibCitations = testGroup "natbib"
6970 [ "citet" =: "\\citet{item1}"
70− =?> para (cite [baseCitation] empty)
71+ =?> para (cite [baseCitation] mempty)
7172 , "suffix" =: "\\citet[p.~30]{item1}"
7273 =?> para
73− (cite [baseCitation{ citationSuffix = toList $ text "p.\160\&30" }] empty)
74+ (cite [baseCitation{ citationSuffix = toList $ text "p.\160\&30" }] mempty)
7475 , "suffix long" =: "\\citet[p.~30, with suffix]{item1}"
7576 =?> para (cite [baseCitation{ citationSuffix =
76− toList $ text "p.\160\&30, with suffix" }] empty)
77+ toList $ text "p.\160\&30, with suffix" }] mempty)
7778 , "multiple" =: "\\citeauthor{item1} \\citetext{\\citeyear{item1}; \\citeyear[p.~30]{item2}; \\citealp[see also][]{item3}}"
7879 =?> para (cite [baseCitation{ citationMode = AuthorInText }
7980 ,baseCitation{ citationMode = SuppressAuthor
@@ -82,7 +83,7 @@ natbibCitations = testGroup "natbib"
8283 ,baseCitation{ citationId = "item3"
8384 , citationPrefix = [Str "see",Space,Str "also"]
8485 , citationMode = NormalCitation }
85− ] empty)
86+ ] mempty)
8687 , "group" =: "\\citetext{\\citealp[see][p.~34--35]{item1}; \\citealp[also][chap. 3]{item3}}"
8788 =?> para (cite [baseCitation{ citationMode = NormalCitation
8889 , citationPrefix = [Str "see"]
@@ -91,36 +92,36 @@ natbibCitations = testGroup "natbib"
9192 , citationId = "item3"
9293 , citationPrefix = [Str "also"]
9394 , citationSuffix = [Str "chap.",Space,Str "3"] }
94− ] empty)
95+ ] mempty)
9596 , "suffix and locator" =: "\\citep[pp.~33, 35--37, and nowhere else]{item1}"
9697 =?> para (cite [baseCitation{ citationMode = NormalCitation
97− , citationSuffix = [Str "pp.\160\&33,",Space,Str "35",EnDash,Str "37,",Space,Str "and",Space,Str "nowhere",Space, Str "else"] }] empty)
98+ , citationSuffix = [Str "pp.\160\&33,",Space,Str "35",EnDash,Str "37,",Space,Str "and",Space,Str "nowhere",Space, Str "else"] }] mempty)
9899 , "suffix only" =: "\\citep[and nowhere else]{item1}"
99100 =?> para (cite [baseCitation{ citationMode = NormalCitation
100− , citationSuffix = toList $ text "and nowhere else" }] empty)
101+ , citationSuffix = toList $ text "and nowhere else" }] mempty)
101102 , "no author" =: "\\citeyearpar{item1}, and now Doe with a locator \\citeyearpar[p.~44]{item2}"
102− =?> para (cite [baseCitation{ citationMode = SuppressAuthor }] empty +++
103− text ", and now Doe with a locator " +++
103+ =?> para (cite [baseCitation{ citationMode = SuppressAuthor }] mempty <>
104+ text ", and now Doe with a locator " <>
104105 cite [baseCitation{ citationMode = SuppressAuthor
105106 , citationSuffix = [Str "p.\160\&44"]
106− , citationId = "item2" }] empty)
107+ , citationId = "item2" }] mempty)
107108 , "markup" =: "\\citep[\\emph{see}][p. \\textbf{32}]{item1}"
108109 =?> para (cite [baseCitation{ citationMode = NormalCitation
109110 , citationPrefix = [Emph [Str "see"]]
110111 , citationSuffix = [Str "p.",Space,
111− Strong [Str "32"]] }] empty)
112+ Strong [Str "32"]] }] mempty)
112113 ]
113114
114115biblatexCitations :: Test
115116biblatexCitations = testGroup "biblatex"
116117 [ "textcite" =: "\\textcite{item1}"
117− =?> para (cite [baseCitation] empty)
118+ =?> para (cite [baseCitation] mempty)
118119 , "suffix" =: "\\textcite[p.~30]{item1}"
119120 =?> para
120− (cite [baseCitation{ citationSuffix = toList $ text "p.\160\&30" }] empty)
121+ (cite [baseCitation{ citationSuffix = toList $ text "p.\160\&30" }] mempty)
121122 , "suffix long" =: "\\textcite[p.~30, with suffix]{item1}"
122123 =?> para (cite [baseCitation{ citationSuffix =
123− toList $ text "p.\160\&30, with suffix" }] empty)
124+ toList $ text "p.\160\&30, with suffix" }] mempty)
124125 , "multiple" =: "\\textcites{item1}[p.~30]{item2}[see also][]{item3}"
125126 =?> para (cite [baseCitation{ citationMode = AuthorInText }
126127 ,baseCitation{ citationMode = NormalCitation
@@ -129,7 +130,7 @@ biblatexCitations = testGroup "biblatex"
129130 ,baseCitation{ citationId = "item3"
130131 , citationPrefix = [Str "see",Space,Str "also"]
131132 , citationMode = NormalCitation }
132− ] empty)
133+ ] mempty)
133134 , "group" =: "\\autocites[see][p.~34--35]{item1}[also][chap. 3]{item3}"
134135 =?> para (cite [baseCitation{ citationMode = NormalCitation
135136 , citationPrefix = [Str "see"]
@@ -138,24 +139,24 @@ biblatexCitations = testGroup "biblatex"
138139 , citationId = "item3"
139140 , citationPrefix = [Str "also"]
140141 , citationSuffix = [Str "chap.",Space,Str "3"] }
141− ] empty)
142+ ] mempty)
142143 , "suffix and locator" =: "\\autocite[pp.~33, 35--37, and nowhere else]{item1}"
143144 =?> para (cite [baseCitation{ citationMode = NormalCitation
144− , citationSuffix = [Str "pp.\160\&33,",Space,Str "35",EnDash,Str "37,",Space,Str "and",Space,Str "nowhere",Space, Str "else"] }] empty)
145+ , citationSuffix = [Str "pp.\160\&33,",Space,Str "35",EnDash,Str "37,",Space,Str "and",Space,Str "nowhere",Space, Str "else"] }] mempty)
145146 , "suffix only" =: "\\autocite[and nowhere else]{item1}"
146147 =?> para (cite [baseCitation{ citationMode = NormalCitation
147− , citationSuffix = toList $ text "and nowhere else" }] empty)
148+ , citationSuffix = toList $ text "and nowhere else" }] mempty)
148149 , "no author" =: "\\autocite*{item1}, and now Doe with a locator \\autocite*[p.~44]{item2}"
149− =?> para (cite [baseCitation{ citationMode = SuppressAuthor }] empty +++
150− text ", and now Doe with a locator " +++
150+ =?> para (cite [baseCitation{ citationMode = SuppressAuthor }] mempty <>
151+ text ", and now Doe with a locator " <>
151152 cite [baseCitation{ citationMode = SuppressAuthor
152153 , citationSuffix = [Str "p.\160\&44"]
153− , citationId = "item2" }] empty)
154+ , citationId = "item2" }] mempty)
154155 , "markup" =: "\\autocite[\\emph{see}][p. \\textbf{32}]{item1}"
155156 =?> para (cite [baseCitation{ citationMode = NormalCitation
156157 , citationPrefix = [Emph [Str "see"]]
157158 , citationSuffix = [Str "p.",Space,
158− Strong [Str "32"]] }] empty)
159+ Strong [Str "32"]] }] mempty)
159160 , "parencite" =: "\\parencite{item1}"
160− =?> para (cite [baseCitation{ citationMode = NormalCitation }] empty)
161+ =?> para (cite [baseCitation{ citationMode = NormalCitation }] mempty)
161162 ]