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 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/Tests/Command.hs') 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 -- cgit v1.2.3