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

Function cases

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

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 case(
8 TestFlags::empty(),
9 &[
10 (TestFlags::A, 1),
11 (TestFlags::all(), 1 | 1 << 1 | 1 << 2),
12 (TestFlags::empty(), 0),
13 (TestFlags::from_bits_retain(1 << 3), 1 << 3),
14 ],
15 TestFlags::union,
16 );
17
18 case(
19 TestFlags::A | TestFlags::C,
20 &[
21 (TestFlags::A | TestFlags::B, 1 | 1 << 1 | 1 << 2),
22 (TestFlags::A, 1 | 1 << 2),
23 ],
24 TestFlags::union,
25 );
26}
27
28#[track_caller]
29fn case<T: Flags + std::fmt::Debug + std::ops::BitOr<Output = T> + std::ops::BitOrAssign + Copy>(

Callers

nothing calls this directly

Calls 1

caseFunction · 0.70

Tested by

no test coverage detected