lo
}).collect();
- assert_eq!(borrow, 0); // <=> assert!((self >= other));
+ assert!(borrow == 0,
+ "Cannot subtract other from self because other is larger than self.");
return BigUint::new(diff);
}
}
}
}
+ #[test]
+ #[should_fail]
+ fn test_sub_fail_on_underflow() {
+ let (a, b) : (BigUint, BigUint) = (Zero::zero(), One::one());
+ a - b;
+ }
+
static mul_triples: &'static [(&'static [BigDigit],
&'static [BigDigit],
&'static [BigDigit])] = &[