From e0a1f7d2cfa1b18210ea13e0aa03747e6c76e5c5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 26 May 2021 09:52:23 -0700 Subject: Command tests: fail if a file contains no tests. And fix a test that failed in that way! --- test/Tests/Command.hs | 5 ++++- test/command/biblatex-basic.md | 8 +++++--- 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 -- cgit v1.2.3