mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-01-30 23:42:13 +00:00
Merge pull request #81 from bitcartel/52_wrapped_shr
Closes #52. Fix test error "attempt to shift right with overflow".
This commit is contained in:
commit
2d97ccb7b8
@ -656,9 +656,9 @@ mod test {
|
||||
for i in 0..60 {
|
||||
let num = rng.gen();
|
||||
let a = UInt32::constant(num).shr(i);
|
||||
let b = UInt32::constant(num >> i);
|
||||
let b = UInt32::constant(num.wrapping_shr(i as u32));
|
||||
|
||||
assert_eq!(a.value.unwrap(), num >> i);
|
||||
assert_eq!(a.value.unwrap(), num.wrapping_shr(i as u32));
|
||||
|
||||
assert_eq!(a.bits.len(), b.bits.len());
|
||||
for (a, b) in a.bits.iter().zip(b.bits.iter()) {
|
||||
|
Loading…
Reference in New Issue
Block a user