-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5c116d
commit b10ef23
Showing
7 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Status: SATISFIED\ | ||
Description: "cover condition: *foo.boxed == i32::MIN" | ||
Status: SATISFIED\ | ||
Description: "cover condition: *foo.boxed == 0" | ||
Status: SATISFIED\ | ||
Description: "cover condition: *foo.boxed == i32::MAX" | ||
Status: UNSATISFIABLE\ | ||
Description: "cover condition: *foo.boxed < i32::MIN" | ||
Status: UNSATISFIABLE\ | ||
Description: "cover condition: *foo.boxed > i32::MAX" | ||
VERIFICATION:- SUCCESSFUL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
//! Check that Kani can automatically derive `Arbitrary` on a struct with a | ||
//! member of type `Box<T>` | ||
#[derive(kani::Arbitrary)] | ||
struct Foo<T> { | ||
boxed: Box<T>, | ||
} | ||
|
||
#[kani::proof] | ||
fn main() { | ||
let foo: Foo<i32> = kani::any(); | ||
kani::cover!(*foo.boxed == i32::MIN); | ||
kani::cover!(*foo.boxed == 0); | ||
kani::cover!(*foo.boxed == i32::MAX); | ||
kani::cover!(*foo.boxed < i32::MIN); // <-- this condition should be `UNSATISFIABLE` | ||
kani::cover!(*foo.boxed > i32::MAX); // <-- this condition should be `UNSATISFIABLE` | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.