Function
case
(
value: T,
inputs: &[(T, bool)],
mut inherent: impl FnMut(&T, T) -> bool,
)
Source from the content-addressed store, hash-verified
| 68 | |
| 69 | #[track_caller] |
| 70 | fn case<T: Flags + std::fmt::Debug + Copy>( |
| 71 | value: T, |
| 72 | inputs: &[(T, bool)], |
| 73 | mut inherent: impl FnMut(&T, T) -> bool, |
| 74 | ) { |
| 75 | for (input, expected) in inputs { |
| 76 | assert_eq!( |
| 77 | *expected, |
| 78 | inherent(&value, *input), |
| 79 | "{:?}.intersects({:?})", |
| 80 | value, |
| 81 | input |
| 82 | ); |
| 83 | assert_eq!( |
| 84 | *expected, |
| 85 | Flags::intersects(&value, *input), |
| 86 | "Flags::intersects({:?}, {:?})", |
| 87 | value, |
| 88 | input |
| 89 | ); |
| 90 | } |
| 91 | } |
Tested by
no test coverage detected