(
expected: T::Bits,
value: T,
inherent: impl FnOnce(T) -> T,
)
| 36 | |
| 37 | #[track_caller] |
| 38 | fn case<T: Flags + std::fmt::Debug + std::ops::Not<Output = T> + Copy>( |
| 39 | expected: T::Bits, |
| 40 | value: T, |
| 41 | inherent: impl FnOnce(T) -> T, |
| 42 | ) where |
| 43 | T::Bits: std::fmt::Debug + PartialEq, |
| 44 | { |
| 45 | assert_eq!(expected, inherent(value).bits(), "{:?}.complement()", value); |
| 46 | assert_eq!( |
| 47 | expected, |
| 48 | Flags::complement(value).bits(), |
| 49 | "Flags::complement({:?})", |
| 50 | value |
| 51 | ); |
| 52 | assert_eq!(expected, (!value).bits(), "!{:?}", value); |
| 53 | } |