better def of is signed in tests.
This commit is contained in:
parent
79e8653656
commit
3ee7bb19c6
1 changed files with 2 additions and 8 deletions
|
@ -124,15 +124,9 @@ fn test_int_from_str_overflow() {
|
|||
fn test_can_not_overflow() {
|
||||
fn can_overflow<T>(radix: u32, input: &str) -> bool
|
||||
where
|
||||
T: Default
|
||||
+ core::ops::Sub<Output = T>
|
||||
+ std::convert::From<bool>
|
||||
+ std::cmp::PartialOrd
|
||||
+ Copy,
|
||||
T: std::convert::TryFrom<i8>,
|
||||
{
|
||||
let one = true.into();
|
||||
let zero = <T>::default();
|
||||
!can_not_overflow::<T>(radix, zero - one < zero, input.as_bytes())
|
||||
!can_not_overflow::<T>(radix, T::try_from(-1_i8).is_ok(), input.as_bytes())
|
||||
}
|
||||
|
||||
// Positive tests:
|
||||
|
|
Loading…
Add table
Reference in a new issue