KEMBAR78
Cram tests for all error cases by gasche · Pull Request #55 · rgrinberg/ocaml-mustache · GitHub
Skip to content

Conversation

@gasche
Copy link
Collaborator

@gasche gasche commented Dec 27, 2020

This PR (on top of #54, which considerably improves the reference outputs) contains cram tests for all existing error cases in the Mustache implementation (parse-time and render-time). As is, it is a bit dull; it mostly shows that many errors are not very good. But that is already useful! I intend to rebase #51 on top of it, so that changes in error messages are reflected in the reference outputs, easier to assess for reviewers (and myself). In the future this could also track improvements and regressions in error messages.

(The mere fact of writing those tests made me realize that the error messages in #51 are an improvement, but still vastly insufficient. Basically they work well in the case where there is a mistake (typo, etc.) in the template file, but they do a very poor job if the mistake is in the JSON file.)

@@ -0,0 +1,2 @@
(cram
(deps %{bin:mustache}))
Copy link
Owner

@rgrinberg rgrinberg Dec 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should depend on all of the .json and .mustache files as well. Or initialize them as part of the test.

Edit: never mind. All the fixtures are inside the .t directories, so the dependency is added automatically.

@gasche gasche merged commit 1c7612e into rgrinberg:master Dec 27, 2020
@gasche
Copy link
Collaborator Author

gasche commented Dec 27, 2020

Thanks! Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants