-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fixme tests for function contracts #3371
base: main
Are you sure you want to change the base?
Conversation
fn check_set_val() { | ||
let mut obj = CharASCII::any(); | ||
let original = obj.0; | ||
let new_val = kani::any_where(|new| *new != original); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.. I used to have an assertion after that relied on it.
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
|
||
impl kani::Arbitrary for CharASCII { | ||
fn any() -> CharASCII { | ||
let val = kani::any_where(|inner: &u8| *inner <= 128); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now needs to be updated to a strict less than (*inner < 128
).
/// receivers. | ||
impl CharASCII { | ||
#[kani::modifies(&self.0)] | ||
#[kani::requires(new_val <= 128)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here (and other occurrences below).
I'm adding a few fix-me tests that I bumped into while working on #3363. Most of them will be fixed by #3363, except the one related to #3370.
The original PR is already quite large, so I decided to just push all of these as fixme tests for now. This is now ready for review!
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.