Improve failure message in case of out of domain failure #287
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 proposes to improve the failure message in case of out of domain failure.
Gospel supports partial function, but OCaml doesn't. The translation from Gospel to OCaml used in Ortac/QCheck-STM interprets an out of domain call to a partial function as raising the
Ortac_runtime.Partial_function
.This is captured by
QCheck
as a test failure (which makes perfect sense), but the ortac runtime is stopped before being able to pass a full report toQCheck
.In order to keep the benefit of the report built by ortac, the PR proposes to:
Ortac_runtime.Partial_function
as false in post and pre conditionsOrtac_runtime.Partial_function
piece of information in a newOut_of_domain
constructor forexpected_value
when computing the expected returned value for the report (the report won't include an expected returned value, as there is none, but the user will have access to the runnable scenario)This allows to always enjoy a full Ortac/QCheck-STM report in case of test failure involving the evaluation of a Gospel partial function.