Skip to content

Commit

Permalink
Merge pull request #152 from n-osborne/next-state-wrn-msg
Browse files Browse the repository at this point in the history
Adapt warning message for ensures not found
  • Loading branch information
n-osborne authored Oct 18, 2023
2 parents df6e4bd + 8f2ebf0 commit 5d15470
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions plugins/qcheck-stm/src/reserr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ let pp_kind ppf kind =
pf ppf "Skipping unsupported modifies clause:@ %a" text
"expected \"modifies x\" or \"modifies x.model\" where x is the SUT"
| Ensures_not_found_for_next_state (f, m) ->
pf ppf "Skipping %s:@ model@ %s@ %a" f m text
"is declared as modified by the function but no translatable ensures \
clause was found"
pf ppf "Skipping %s:@ model@ %s %a@;%a%s%a" f m text
"is declared as modified by the function but no suitable ensures \
clause was found."
text "Specifications should contain at least one \"ensures x." m text
" = ...\" where x is the SUT"
| Functional_argument f ->
pf ppf "Skipping %s:@ %a" f text
"functions are not supported yet as arguments"
Expand Down
5 changes: 3 additions & 2 deletions plugins/qcheck-stm/test/all_warnings_errors.expected
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ File "all_warnings.mli", line 37, characters 13-23:
37 | modifies t.contents *)
^^^^^^^^^^
Warning: Skipping ensures_not_found_for_next_state: model contents is
declared as modified by the function but no translatable ensures
clause was found.
declared as modified by the function but no suitable ensures clause
was found. Specifications should contain at least one "ensures
x.contents = ..." where x is the SUT.
File "all_warnings.mli", line 53, characters 16-54:
53 | ensures b = forall a. List.mem a t.contents -> p a *)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 5d15470

Please sign in to comment.