Add kani test and remove TODO
Add a kani test to check `div_rem`.
This commit is contained in:
parent
d08d3efdfa
commit
66352cba98
|
@ -1735,7 +1735,6 @@ mod tests {
|
||||||
mod verification {
|
mod verification {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
// TODO: After we verify div_rem assert x * y / y == x
|
|
||||||
#[kani::unwind(5)] // mul_u64 loops over 4 64 bit ints so use one more than 4
|
#[kani::unwind(5)] // mul_u64 loops over 4 64 bit ints so use one more than 4
|
||||||
#[kani::proof]
|
#[kani::proof]
|
||||||
fn check_mul_u64() {
|
fn check_mul_u64() {
|
||||||
|
@ -1744,4 +1743,13 @@ mod verification {
|
||||||
|
|
||||||
let _ = x.mul_u64(y);
|
let _ = x.mul_u64(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[kani::unwind(5)] // I can't remember exactly why we need this.
|
||||||
|
#[kani::proof]
|
||||||
|
fn check_div_rem() {
|
||||||
|
let x: U256 = kani::any();
|
||||||
|
let y: U256 = kani::any();
|
||||||
|
|
||||||
|
assert_eq!(x * y / y, x);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue