Skip to content

Commit

Permalink
fix(bolero-kani): use cover instead of assume
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Sep 28, 2023
1 parent 8d84647 commit ad7dd53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/bolero-kani/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ pub mod lib {
let mut input = KaniInput { options };
match test.test(&mut input) {
Ok(was_valid) => {
// make sure the input that we generated was valid
kani::assume(was_valid);
// show if the generator was satisfiable
// TODO fail the harness if it's not: https://github.com/model-checking/kani/issues/2792
#[cfg(kani)]
kani::cover!(
was_valid,
"the generator should produce at least one valid value"
);
}
Err(_) => {
panic!("test failed");
Expand Down

0 comments on commit ad7dd53

Please sign in to comment.