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:
str4d 2019-05-28 18:55:25 +01:00 committed by GitHub
commit 2d97ccb7b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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()) {