File tree Expand file tree Collapse file tree 2 files changed +3005
-500
lines changed Expand file tree Collapse file tree 2 files changed +3005
-500
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments