git.iko.soy/typeable/pandoc
on master help sign in
Updated tests for tight/loose lists.

Taking into account new context/latex output, and fixing some bugs in the test suite Tests.Helpers and Tests.Writers.ConTeXt. (We had the wrong order of expected/actual in the diff output.)

commit8ff81dc9caaff9e5dffbbe9148dfcf547c27d147 authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 7 Jan 2013, 20:58 (14 years ago) parent1a9193c
4 files changed+67−37
tests/Tests/Helpers.hs+2−2 tests/Tests/Writers/ConTeXt.hs+10−9 tests/writer.context+26−26 tests/writer.latex+29
tests/Tests/Helpers.hs+2−2
@@ -62,8 +62,8 @@ test fn name (input, expected) =
6262 actual' = toString $ fn input
6363 expected' = toString expected
6464 diff = getDiff (lines expected') (lines actual')
65− expected'' = unlines $ map vividize [Second x | Second x <- diff]
66− actual'' = unlines $ map vividize [First x | First x <- diff]
65+ expected'' = unlines $ map vividize [First x | First x <- diff]
66+ actual'' = unlines $ map vividize [Second x | Second x <- diff]
6767 dashes "" = replicate 72 '-'
6868 dashes x = replicate (72 - length x - 5) '-' ++ " " ++ x ++ " ---"
6969
tests/Tests/Writers/ConTeXt.hs+10−9
@@ -46,19 +46,20 @@ tests = [ testGroup "inline code"
4646 ]
4747 , testGroup "bullet lists"
4848 [ "nested" =:
49− bulletList [plain (text "top")
50− ,bulletList [plain (text "next")
51− ,bulletList [plain (text "bot")]]]
52− =?> [_LIT|
53−\startitemize
49+ bulletList [
50+ plain (text "top")
51+ <> bulletList [
52+ plain (text "next")
53+ <> bulletList [plain (text "bot")]
54+ ]
55+ ] =?> [_LIT|
56+\startitemize[packed]
5457\item
5558 top
56−\item
57− \startitemize
59+ \startitemize[packed]
5860 \item
5961 next
60− \item
61− \startitemize
62+ \startitemize[packed]
6263 \item
6364 bot
6465 \stopitemize
tests/writer.context+26−26
@@ -115,7 +115,7 @@ sub status {
115115
116116A list:
117117
118−\startitemize[n][stopper=.]
118+\startitemize[n,packed][stopper=.]
119119\item
120120 item one
121121\item
@@ -169,7 +169,7 @@ These should not be escaped: \$ \\ \> \[ \{
169169
170170Asterisks tight:
171171
172−\startitemize
172+\startitemize[packed]
173173\item
174174 asterisk 1
175175\item
@@ -191,7 +191,7 @@ Asterisks loose:
191191
192192Pluses tight:
193193
194−\startitemize
194+\startitemize[packed]
195195\item
196196 Plus 1
197197\item
@@ -213,7 +213,7 @@ Pluses loose:
213213
214214Minuses tight:
215215
216−\startitemize
216+\startitemize[packed]
217217\item
218218 Minus 1
219219\item
@@ -237,7 +237,7 @@ Minuses loose:
237237
238238Tight:
239239
240−\startitemize[n][stopper=.]
240+\startitemize[n,packed][stopper=.]
241241\item
242242 First
243243\item
@@ -248,7 +248,7 @@ Tight:
248248
249249and:
250250
251−\startitemize[n][stopper=.]
251+\startitemize[n,packed][stopper=.]
252252\item
253253 One
254254\item
@@ -294,13 +294,13 @@ Multiple paragraphs:
294294
295295\subsection[nested]{Nested}
296296
297−\startitemize
297+\startitemize[packed]
298298\item
299299 Tab
300− \startitemize
300+ \startitemize[packed]
301301 \item
302302 Tab
303− \startitemize
303+ \startitemize[packed]
304304 \item
305305 Tab
306306 \stopitemize
@@ -309,12 +309,12 @@ Multiple paragraphs:
309309
310310Here's another:
311311
312−\startitemize[n][stopper=.]
312+\startitemize[n,packed][stopper=.]
313313\item
314314 First
315315\item
316316 Second:
317− \startitemize
317+ \startitemize[packed]
318318 \item
319319 Fee
320320 \item
@@ -334,7 +334,7 @@ Same thing but with paragraphs:
334334\item
335335 Second:
336336
337− \startitemize
337+ \startitemize[packed]
338338 \item
339339 Fee
340340 \item
@@ -372,12 +372,12 @@ Same thing but with paragraphs:
372372
373373 with a continuation
374374
375− \startitemize[r][start=4,stopper=.,width=2.0em]
375+ \startitemize[r,packed][start=4,stopper=.,width=2.0em]
376376 \item
377377 sublist with roman numerals, starting with 4
378378 \item
379379 more items
380− \startitemize[A][left=(,stopper=),width=2.0em]
380+ \startitemize[A,packed][left=(,stopper=),width=2.0em]
381381 \item
382382 a subsublist
383383 \item
@@ -388,16 +388,16 @@ Same thing but with paragraphs:
388388
389389Nesting:
390390
391−\startitemize[A][stopper=.]
391+\startitemize[A,packed][stopper=.]
392392\item
393393 Upper Alpha
394− \startitemize[R][stopper=.]
394+ \startitemize[R,packed][stopper=.]
395395 \item
396396 Upper Roman.
397− \startitemize[n][start=6,left=(,stopper=),width=2.0em]
397+ \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
398398 \item
399399 Decimal start with 6
400− \startitemize[a][start=3,stopper=)]
400+ \startitemize[a,packed][start=3,stopper=)]
401401 \item
402402 Lower alpha with paren
403403 \stopitemize
@@ -407,12 +407,12 @@ Nesting:
407407
408408Autonumbering:
409409
410−\startitemize[n]
410+\startitemize[n,packed]
411411\item
412412 Autonumber.
413413\item
414414 More.
415− \startitemize[a]
415+ \startitemize[a,packed]
416416 \item
417417 Nested.
418418 \stopitemize
@@ -529,7 +529,7 @@ Blank line after term, indented marker, alternate markers:
529529\startdescription{orange}
530530 orange fruit
531531
532− \startitemize[n][stopper=.]
532+ \startitemize[n,packed][stopper=.]
533533 \item
534534 sublist
535535 \item
@@ -646,7 +646,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
646646
647647\section[latex]{LaTeX}
648648
649−\startitemize
649+\startitemize[packed]
650650\item
651651 \cite[22-23]{smith.1899}
652652\item
@@ -668,7 +668,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
668668
669669These shouldn't be math:
670670
671−\startitemize
671+\startitemize[packed]
672672\item
673673 To get the famous equation, write \type{$e = mc^2$}.
674674\item
@@ -688,7 +688,7 @@ Here's a LaTeX table:
688688
689689Here is some unicode:
690690
691−\startitemize
691+\startitemize[packed]
692692\item
693693 I hat: Î
694694\item
@@ -813,7 +813,7 @@ braces]\from[url26].
813813With an ampersand:
814814\useURL[url27][http://example.com/?foo=1&bar=2][][\hyphenatedurl{http://example.com/?foo=1&bar=2}]\from[url27]
815815
816−\startitemize
816+\startitemize[packed]
817817\item
818818 In a list?
819819\item
@@ -873,7 +873,7 @@ note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
873873Notes can go in quotes.\footnote{In quote.}
874874\stopblockquote
875875
876−\startitemize[n][stopper=.]
876+\startitemize[n,packed][stopper=.]
877877\item
878878 And in list items.\footnote{In list.}
879879\stopitemize
tests/writer.latex+29
@@ -122,6 +122,7 @@ A list:
122122
123123\begin{enumerate}
124124\def\labelenumi{\arabic{enumi}.}
125+\itemsep1pt\parskip0pt\parsep0pt
125126\item
126127 item one
127128\item
@@ -176,6 +177,7 @@ These should not be escaped: \$ \\ \> \[ \{
176177Asterisks tight:
177178
178179\begin{itemize}
180+\itemsep1pt\parskip0pt\parsep0pt
179181\item
180182 asterisk 1
181183\item
@@ -198,6 +200,7 @@ Asterisks loose:
198200Pluses tight:
199201
200202\begin{itemize}
203+\itemsep1pt\parskip0pt\parsep0pt
201204\item
202205 Plus 1
203206\item
@@ -220,6 +223,7 @@ Pluses loose:
220223Minuses tight:
221224
222225\begin{itemize}
226+\itemsep1pt\parskip0pt\parsep0pt
223227\item
224228 Minus 1
225229\item
@@ -245,6 +249,7 @@ Tight:
245249
246250\begin{enumerate}
247251\def\labelenumi{\arabic{enumi}.}
252+\itemsep1pt\parskip0pt\parsep0pt
248253\item
249254 First
250255\item
@@ -257,6 +262,7 @@ and:
257262
258263\begin{enumerate}
259264\def\labelenumi{\arabic{enumi}.}
265+\itemsep1pt\parskip0pt\parsep0pt
260266\item
261267 One
262268\item
@@ -306,14 +312,17 @@ Multiple paragraphs:
306312\subsection{Nested}
307313
308314\begin{itemize}
315+\itemsep1pt\parskip0pt\parsep0pt
309316\item
310317 Tab
311318
312319 \begin{itemize}
320+ \itemsep1pt\parskip0pt\parsep0pt
313321 \item
314322 Tab
315323
316324 \begin{itemize}
325+ \itemsep1pt\parskip0pt\parsep0pt
317326 \item
318327 Tab
319328 \end{itemize}
@@ -324,12 +333,14 @@ Here's another:
324333
325334\begin{enumerate}
326335\def\labelenumi{\arabic{enumi}.}
336+\itemsep1pt\parskip0pt\parsep0pt
327337\item
328338 First
329339\item
330340 Second:
331341
332342 \begin{itemize}
343+ \itemsep1pt\parskip0pt\parsep0pt
333344 \item
334345 Fee
335346 \item
@@ -351,6 +362,7 @@ Same thing but with paragraphs:
351362 Second:
352363
353364 \begin{itemize}
365+ \itemsep1pt\parskip0pt\parsep0pt
354366 \item
355367 Fee
356368 \item
@@ -393,6 +405,7 @@ Same thing but with paragraphs:
393405 \begin{enumerate}
394406 \def\labelenumii{\roman{enumii}.}
395407 \setcounter{enumii}{3}
408+ \itemsep1pt\parskip0pt\parsep0pt
396409 \item
397410 sublist with roman numerals, starting with 4
398411 \item
@@ -400,6 +413,7 @@ Same thing but with paragraphs:
400413
401414 \begin{enumerate}
402415 \def\labelenumiii{(\Alph{enumiii})}
416+ \itemsep1pt\parskip0pt\parsep0pt
403417 \item
404418 a subsublist
405419 \item
@@ -412,23 +426,27 @@ Nesting:
412426
413427\begin{enumerate}
414428\def\labelenumi{\Alph{enumi}.}
429+\itemsep1pt\parskip0pt\parsep0pt
415430\item
416431 Upper Alpha
417432
418433 \begin{enumerate}
419434 \def\labelenumii{\Roman{enumii}.}
435+ \itemsep1pt\parskip0pt\parsep0pt
420436 \item
421437 Upper Roman.
422438
423439 \begin{enumerate}
424440 \def\labelenumiii{(\arabic{enumiii})}
425441 \setcounter{enumiii}{5}
442+ \itemsep1pt\parskip0pt\parsep0pt
426443 \item
427444 Decimal start with 6
428445
429446 \begin{enumerate}
430447 \def\labelenumiv{\alph{enumiv})}
431448 \setcounter{enumiv}{2}
449+ \itemsep1pt\parskip0pt\parsep0pt
432450 \item
433451 Lower alpha with paren
434452 \end{enumerate}
@@ -439,12 +457,14 @@ Nesting:
439457Autonumbering:
440458
441459\begin{enumerate}
460+\itemsep1pt\parskip0pt\parsep0pt
442461\item
443462 Autonumber.
444463\item
445464 More.
446465
447466 \begin{enumerate}
467+ \itemsep1pt\parskip0pt\parsep0pt
448468 \item
449469 Nested.
450470 \end{enumerate}
@@ -463,6 +483,7 @@ B. Williams
463483Tight using spaces:
464484
465485\begin{description}
486+\itemsep1pt\parskip0pt\parsep0pt
466487\item[apple]
467488red fruit
468489\item[orange]
@@ -474,6 +495,7 @@ yellow fruit
474495Tight using tabs:
475496
476497\begin{description}
498+\itemsep1pt\parskip0pt\parsep0pt
477499\item[apple]
478500red fruit
479501\item[orange]
@@ -515,6 +537,7 @@ orange block quote
515537Multiple definitions, tight:
516538
517539\begin{description}
540+\itemsep1pt\parskip0pt\parsep0pt
518541\item[apple]
519542red fruit
520543
@@ -550,6 +573,7 @@ orange fruit
550573
551574\begin{enumerate}
552575\def\labelenumi{\arabic{enumi}.}
576+\itemsep1pt\parskip0pt\parsep0pt
553577\item
554578 sublist
555579\item
@@ -675,6 +699,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
675699\section{LaTeX}
676700
677701\begin{itemize}
702+\itemsep1pt\parskip0pt\parsep0pt
678703\item
679704 \cite[22-23]{smith.1899}
680705\item
@@ -697,6 +722,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
697722These shouldn't be math:
698723
699724\begin{itemize}
725+\itemsep1pt\parskip0pt\parsep0pt
700726\item
701727 To get the famous equation, write \texttt{\$e = mc\^{}2\$}.
702728\item
@@ -723,6 +749,7 @@ Cat & 1 \\ \hline
723749Here is some unicode:
724750
725751\begin{itemize}
752+\itemsep1pt\parskip0pt\parsep0pt
726753\item
727754 I hat: Î
728755\item
@@ -846,6 +873,7 @@ Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
846873With an ampersand: \url{http://example.com/?foo=1\&bar=2}
847874
848875\begin{itemize}
876+\itemsep1pt\parskip0pt\parsep0pt
849877\item
850878 In a list?
851879\item
@@ -910,6 +938,7 @@ Notes can go in quotes.\footnote{In quote.}
910938
911939\begin{enumerate}
912940\def\labelenumi{\arabic{enumi}.}
941+\itemsep1pt\parskip0pt\parsep0pt
913942\item
914943 And in list items.\footnote{In list.}
915944\end{enumerate}