Function
case
(expected: T::Bits, input: T::Bits, inherent: impl FnOnce(T::Bits) -> T)
Source from the content-addressed store, hash-verified
| 24 | |
| 25 | #[track_caller] |
| 26 | fn case<T: Flags>(expected: T::Bits, input: T::Bits, inherent: impl FnOnce(T::Bits) -> T) |
| 27 | where |
| 28 | <T as Flags>::Bits: std::fmt::Debug + PartialEq, |
| 29 | { |
| 30 | assert_eq!( |
| 31 | expected, |
| 32 | inherent(input).bits(), |
| 33 | "T::from_bits_truncate({:?})", |
| 34 | input |
| 35 | ); |
| 36 | assert_eq!( |
| 37 | expected, |
| 38 | T::from_bits_truncate(input).bits(), |
| 39 | "Flags::from_bits_truncate({:?})", |
| 40 | input |
| 41 | ); |
| 42 | } |
Tested by
no test coverage detected