fix failing cmp_parse test

While with the actual string

    f ≤ string < f+Δ

we are using a parsed version, which could be actually larger than
string so that the test should only check

    f ≤ parsed ≤ f+Δ
This commit is contained in:
Trevor Spiteri 2020-02-24 14:29:34 +01:00
parent c6d8e14537
commit aeac17c0d8
1 changed files with 2 additions and 2 deletions

View File

@ -303,8 +303,8 @@ mod tests {
F::Bits: TryFrom<u8>,
{
let sf = F::from_str(s).unwrap();
let one = F::Bits::try_from(1).ok().unwrap();
assert!(f <= sf && sf < f + F::from_bits(one));
let f_plus = f + F::from_bits(F::Bits::try_from(1).ok().unwrap());
assert!(f <= sf && sf <= f_plus);
}
#[test]