Cram tests for all error cases #55
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.)