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