Skip to content

Commit

Permalink
Change test to require impl (#87)
Browse files Browse the repository at this point in the history
impl std::ops::Add<&SaturatingU16> for SaturatingU16
  • Loading branch information
c-git authored Jun 20, 2024
1 parent c86360f commit 468de3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exercises/04_traits/14_outro/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit 468de3c

Please sign in to comment.