Skip to content

Commit 112b242

Browse files
committed
test: add a proof taking two contracts and a complete contract
Ref: #16
1 parent 6b753b6 commit 112b242

File tree

2 files changed

+3005
-500
lines changed

2 files changed

+3005
-500
lines changed

tests/proofs/standard_proofs_with_contracts.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod verify {
44
fn contract_requires(a: u8) {}
55

66
#[kani::proof]
7-
fn standard_proof_with_contract_requires() {
7+
fn single_contract_requires() {
88
contract_requires(0);
99
}
1010

@@ -14,7 +14,25 @@ mod verify {
1414
}
1515

1616
#[kani::proof]
17-
fn standard_proof_with_contract_ensures() {
17+
fn single_with_contract_ensures() {
1818
contract_ensures(0);
1919
}
20+
21+
#[kani::proof]
22+
fn two_contracts_requires_and_ensures() {
23+
let val = contract_ensures(0);
24+
contract_ensures(val);
25+
}
26+
27+
#[kani::requires(a > 0)]
28+
#[kani::ensures(|&ret| ret > 0)]
29+
fn contract(a: u8) -> u8 {
30+
a
31+
}
32+
33+
#[kani::proof]
34+
fn single_contract() {
35+
let val = contract(1);
36+
assert!(val > 0);
37+
}
2038
}

0 commit comments

Comments
 (0)