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

Function cases

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

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 case(
8 TestFlags::empty(),
9 &[(TestFlags::empty(), 0), (TestFlags::all(), 0)],
10 TestFlags::intersection,
11 );
12
13 case(
14 TestFlags::all(),
15 &[
16 (TestFlags::all(), 1 | 1 << 1 | 1 << 2),
17 (TestFlags::A, 1),
18 (TestFlags::from_bits_retain(1 << 3), 0),
19 ],
20 TestFlags::intersection,
21 );
22
23 case(
24 TestFlags::from_bits_retain(1 << 3),
25 &[(TestFlags::from_bits_retain(1 << 3), 1 << 3)],
26 TestFlags::intersection,
27 );
28
29 case(
30 TestOverlapping::AB,
31 &[(TestOverlapping::BC, 1 << 1)],
32 TestOverlapping::intersection,
33 );
34}
35
36#[track_caller]
37fn case<T: Flags + std::fmt::Debug + std::ops::BitAnd<Output = T> + std::ops::BitAndAssign + Copy>(

Callers

nothing calls this directly

Calls 1

caseFunction · 0.70

Tested by

no test coverage detected