From c44ff4c555925e083a5debf3fdf6e2feb459be05 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 12 Nov 2010 00:38:31 -0800 Subject: Added material for citation tests. Currently they fail with a multibyte error from citeproc-hs when it tries to read locale. --- tests/RunTests.hs | 2 + tests/biblio.bib | 26 +++ tests/chicago-author-date.csl | 369 ++++++++++++++++++++++++++++++++++++++ tests/ieee.csl | 129 ++++++++++++++ tests/markdown-citations.plain | 36 ++++ tests/markdown-citations.txt | 28 +++ tests/mhra.csl | 390 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 980 insertions(+) create mode 100644 tests/biblio.bib create mode 100644 tests/chicago-author-date.csl create mode 100644 tests/ieee.csl create mode 100644 tests/markdown-citations.plain create mode 100644 tests/markdown-citations.txt create mode 100644 tests/mhra.csl diff --git a/tests/RunTests.hs b/tests/RunTests.hs index 1715400fd..f58221846 100644 --- a/tests/RunTests.hs +++ b/tests/RunTests.hs @@ -106,6 +106,7 @@ main = do "latex-reader.latex" "latex-reader.native" r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"] "testsuite.native" "testsuite.native" + r14 <- runTest "markdown reader (citations)" ["-r", "markdown", "-w", "plain", "--biblio", "biblio.bib", "--csl", "chicago-author-date.csl"] "markdown-citations.txt" "markdown-citations.plain" r12s <- if runLhsTests then mapM runLhsWriterTest lhsWriterFormats else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return [] @@ -119,6 +120,7 @@ main = do , r9 -- html , r10 -- latex , r11 -- native + , r14 -- citations ] ++ r12s ++ r13s if all id results then do diff --git a/tests/biblio.bib b/tests/biblio.bib new file mode 100644 index 000000000..d395eb5b8 --- /dev/null +++ b/tests/biblio.bib @@ -0,0 +1,26 @@ +@Book{item1, +author="John Doe", +title="First Book", +year="2005", +address="Cambridge", +publisher="Cambridge University Press" +} + +@Article{item2, +author="John Doe", +title="Article", +year="2006", +journal="Journal of Generic Studies", +volume="6", +pages="33-34" +} + +@InCollection{item3, +author="John Doe and Jenny Roe", +title="Why Water Is Wet", +booktitle="Third Book", +editor="Sam Smith", +publisher="Oxford University PresS", +address="Oxford", +year="2007" +} diff --git a/tests/chicago-author-date.csl b/tests/chicago-author-date.csl new file mode 100644 index 000000000..f16f82305 --- /dev/null +++ b/tests/chicago-author-date.csl @@ -0,0 +1,369 @@ + + diff --git a/tests/ieee.csl b/tests/ieee.csl new file mode 100644 index 000000000..2e0af1795 --- /dev/null +++ b/tests/ieee.csl @@ -0,0 +1,129 @@ + + \ No newline at end of file diff --git a/tests/markdown-citations.plain b/tests/markdown-citations.plain new file mode 100644 index 000000000..8521e8c0b --- /dev/null +++ b/tests/markdown-citations.plain @@ -0,0 +1,36 @@ +Pandoc with citeproc-hs +======================= + +[@nonexistent] + +@nonexistent + +Doe (2005) says blah. Doe (2005, 30) says blah. Doe (2005; 2006, +30; see also Doe and Roe 2007) says blah. + +In a note.[^1] A citation group +(see Doe 2005, 34-35; also Doe and Roe 2007, chap. 3). Another one +(see Doe 2005, 34-35). And another one in a note.[^2] + +Now some modifiers.[^3] + +References +========== + +Doe, John. 2005. First Book. Cambridge: Cambridge University Press. + +---. 2006. Article. Journal of Generic Studies 6: 33-34. + +Doe, John, and Jenny Roe. 2007. Why Water Is Wet. Sam Smith Ed. +Third Book. Oxford: Oxford University Press. + +[^1]: + A citation without locators [Doe and Roe (2007)]. + +[^2]: + Some citations (see Doe 2006, chap. 3; Doe and Roe 2007; Doe + 2005). + +[^3]: + Like a citation without author: (2005), and now Doe with a + locator (2006, 44). diff --git a/tests/markdown-citations.txt b/tests/markdown-citations.txt new file mode 100644 index 000000000..59206f0a4 --- /dev/null +++ b/tests/markdown-citations.txt @@ -0,0 +1,28 @@ +# Pandoc with citeproc-hs + +[@nonexistent] + +@nonexistent + +@item1 says blah. +@item1 [p. 30] says blah. +@item1 [-@item2, p. 30; see also @item3] says blah. + +In a note.[^1] A citation group [see +@item1, p. 34-35; also @item3, chap. 3]. Another one [see +@item1, p. 34-35]. And another one in a note.[^2] + +Now some modifiers.[^3] + +[^1]: + A citation without locators [@item3]. + +[^2]: + Some citations [see @item2, chap. 3; @item3; @item1]. + +[^3]: + Like a citation without author: [-@item1], and now Doe with a + locator [-@item2, p. 44]. + +# References + diff --git a/tests/mhra.csl b/tests/mhra.csl new file mode 100644 index 000000000..4749cdcd7 --- /dev/null +++ b/tests/mhra.csl @@ -0,0 +1,390 @@ + + \ No newline at end of file -- cgit v1.2.3