We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b11ba8 commit 32d8b03Copy full SHA for 32d8b03
src/arbitrary.rs
@@ -824,7 +824,9 @@ macro_rules! signed_shrinker {
824
impl Iterator for SignedShrinker {
825
type Item = $ty;
826
fn next(&mut self) -> Option<$ty> {
827
- if (self.x - self.i).abs() < self.x.abs() {
+ if self.x == <$ty>::MIN
828
+ || (self.x - self.i).abs() < self.x.abs()
829
+ {
830
let result = Some(self.x - self.i);
831
self.i = self.i / 2;
832
result
src/tester.rs
@@ -443,7 +443,7 @@ mod test {
443
#[test]
444
fn regression_signed_shrinker_panic() {
445
fn foo_can_shrink(v: i8) -> bool {
446
- let _ = crate::Arbitrary::shrink(&v);
+ let _ = crate::Arbitrary::shrink(&v).take(100).count();
447
true
448
}
449
crate::quickcheck(foo_can_shrink as fn(i8) -> bool);
0 commit comments