-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added `requires` test case Made tests `expected` tests Changes `requires_ensures` macro to function
- Loading branch information
1 parent
cc0e7d7
commit 1ebba9e
Showing
19 changed files
with
157 additions
and
71 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
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
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
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
5 changes: 5 additions & 0 deletions
5
tests/expected/function-contract/arbitrary_ensures_fail.expected
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,5 @@ | ||
RESULTS: | ||
Check 1: arbitrary_ensures_fail::max.missing_definition.1 | ||
- Status: FAILURE | ||
- Description: "Function `arbitrary_ensures_fail::max` with missing definition is unreachable" | ||
- Location: Unknown file in function arbitrary_ensures_fail::max |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
tests/expected/function-contract/arbitrary_ensures_pass.expected
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,5 @@ | ||
RESULTS: | ||
Check 1: arbitrary_ensures_pass::max.missing_definition.1 | ||
- Status: SUCCESS | ||
- Description: "Function `arbitrary_ensures_pass::max` with missing definition is unreachable" | ||
- Location: Unknown file in function arbitrary_ensures_pass::max |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
tests/expected/function-contract/arbitrary_requires_fail.expected
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,10 @@ | ||
RESULTS: | ||
Check 1: div.assertion.1 | ||
- Status: FAILURE | ||
- Description: "attempt to divide by zero" | ||
- Location: arbitrary_requires_fail.rs:6:5 in function div | ||
|
||
Check 2: div.division-by-zero.1 | ||
- Status: SUCCESS | ||
- Description: "division by zero" | ||
- Location: arbitrary_requires_fail.rs:6:5 in function div |
12 changes: 12 additions & 0 deletions
12
tests/expected/function-contract/arbitrary_requires_fail.rs
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,12 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// kani-verify-fail | ||
|
||
fn div(dividend: u32, divisor: u32) -> u32 { | ||
dividend / divisor | ||
} | ||
|
||
#[kani::proof] | ||
fn main() { | ||
div(kani::any(), kani::any()); | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/expected/function-contract/arbitrary_requires_pass.expected
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,10 @@ | ||
RESULTS: | ||
Check 1: div.assertion.1 | ||
- Status: SUCCESS | ||
- Description: "attempt to divide by zero" | ||
- Location: arbitrary_requires_pass.rs:6:5 in function div | ||
|
||
Check 2: div.division-by-zero.1 | ||
- Status: SUCCESS | ||
- Description: "division by zero" | ||
- Location: arbitrary_requires_pass.rs:6:5 in function div |
12 changes: 12 additions & 0 deletions
12
tests/expected/function-contract/arbitrary_requires_pass.rs
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,12 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
#[kani::requires(divisor != 0)] | ||
fn div(dividend: u32, divisor: u32) -> u32 { | ||
dividend / divisor | ||
} | ||
|
||
#[kani::proof] | ||
fn main() { | ||
div(kani::any(), kani::any()); | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/expected/function-contract/simple_ensures_fail.expected
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,5 @@ | ||
RESULTS: | ||
Check 1: simple_ensures_fail::max.missing_definition.1 | ||
- Status: FAILURE | ||
- Description: "Function `simple_ensures_fail::max` with missing definition is unreachable" | ||
- Location: Unknown file in function simple_ensures_fail::max |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
tests/expected/function-contract/simple_ensures_pass.expected
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,5 @@ | ||
RESULTS: | ||
Check 1: simple_ensures_pass::max.missing_definition.1 | ||
- Status: SUCCESS | ||
- Description: "Function `simple_ensures_pass::max` with missing definition is unreachable" | ||
- Location: Unknown file in function simple_ensures_pass::max |
File renamed without changes.