aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-05-26 09:52:23 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-05-26 09:52:23 -0700
commite0a1f7d2cfa1b18210ea13e0aa03747e6c76e5c5 (patch)
tree10008e31b1cf7a3e8fd00f6ea0d6acad4aa5caa7
parent6804f47383a954fc1fb48e44ab0383f9f72d5dea (diff)
downloadpandoc-e0a1f7d2cfa1b18210ea13e0aa03747e6c76e5c5.tar.gz
Command tests: fail if a file contains no tests.
And fix a test that failed in that way!
-rw-r--r--test/Tests/Command.hs5
-rw-r--r--test/command/biblatex-basic.md8
2 files changed, 9 insertions, 4 deletions
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs
index 3ec6d7230..539be1a1a 100644
--- a/test/Tests/Command.hs
+++ b/test/Tests/Command.hs
@@ -130,4 +130,7 @@ extractCommandTest testExePath fp = unsafePerformIO $ do
def{ readerExtensions = pandocExtensions } contents)
let codeblocks = map extractCode $ filter isCodeBlock blocks
let cases = zipWith (runCommandTest testExePath fp) [1..] codeblocks
- return $ testGroup fp cases
+ return $ testGroup fp
+ $ if null cases
+ then [testCase "!!" $ assertFailure "No command tests defined"]
+ else cases
diff --git a/test/command/biblatex-basic.md b/test/command/biblatex-basic.md
index 1110b0fb4..8a1176999 100644
--- a/test/command/biblatex-basic.md
+++ b/test/command/biblatex-basic.md
@@ -1,3 +1,5 @@
+```
+% pandoc -f biblatex -t markdown -s
@Book{item1,
author="John Doe",
title="First Book",
@@ -27,7 +29,7 @@ year="2007"
^D
---
-nocite: '[@*]'
+nocite: "[@*]"
references:
- author:
- family: Doe
@@ -44,9 +46,9 @@ references:
container-title: Journal of Generic Studies
id: item2
issued: 2006
- page: '33-34'
+ page: 33-34
title: Article
- type: 'article-journal'
+ type: article-journal
volume: 6
- author:
- family: Doe