MCPcopy Create free account
hub / github.com/bitflags/bitflags / cases

Function cases

src/tests/is_all.rs:6–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 case(false, TestFlags::empty(), TestFlags::is_all);
8 case(false, TestFlags::A, TestFlags::is_all);
9
10 case(true, TestFlags::ABC, TestFlags::is_all);
11
12 case(
13 true,
14 TestFlags::ABC | TestFlags::from_bits_retain(1 << 3),
15 TestFlags::is_all,
16 );
17
18 case(true, TestZero::empty(), TestZero::is_all);
19
20 case(true, TestEmpty::empty(), TestEmpty::is_all);
21}
22
23#[track_caller]
24fn case<T: Flags + std::fmt::Debug>(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) {

Callers

nothing calls this directly

Calls 1

caseFunction · 0.70

Tested by

no test coverage detected