Change test to require impl (#87)

impl std::ops::Add<&SaturatingU16> for SaturatingU16
This commit is contained in:
Onè 2024-06-20 04:21:14 -04:00 committed by GitHub
parent c86360f3c4
commit 468de3c0ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -6,11 +6,12 @@ fn test_saturating_u16() {
let b: SaturatingU16 = 5u8.into();
let c: SaturatingU16 = u16::MAX.into();
let d: SaturatingU16 = (&1u16).into();
let e = &c;
assert_eq!(a + b, SaturatingU16::from(15u16));
assert_eq!(a + c, SaturatingU16::from(u16::MAX));
assert_eq!(a + d, SaturatingU16::from(11u16));
assert_eq!(a + a, 20u16);
assert_eq!(a + 5u16, 15u16);
assert_eq!(a + &u16::MAX, SaturatingU16::from(u16::MAX));
assert_eq!(a + e, SaturatingU16::from(u16::MAX));
}