Skip to content

Commit 2475ea1

Browse files
committed
Better error message for errors
1 parent d9eb72c commit 2475ea1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Purepur/Generate.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ generateTestFromMarkdown title (Just comment) = do
6464
--TODO: warn user about ignored expr
6565
error $ "unused expression: " <> show expr
6666
commandsToDocument title [] = mempty
67+
commandsToDocument title (ExpectedOutput str: rest) =
68+
error $ "Could not translate doctest comment: Found expected output " <> show str <> ", but no matching command."
69+
<> " Maybe you missed a `>`? "
6770

6871
generateTestFromMarkdownFile :: (FilePath, T.Text) -> Except ParseError (PurepurDocument, P.ModuleName)
6972
generateTestFromMarkdownFile (path, textContent) = do

0 commit comments

Comments
 (0)