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

Function cases

src/tests/insert.rs:6–29  ·  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::A | TestFlags::B, 1 | 1 << 1),
12 (TestFlags::empty(), 0),
13 (TestFlags::from_bits_retain(1 << 3), 1 << 3),
14 ],
15 TestFlags::insert,
16 TestFlags::set,
17 );
18
19 case(
20 TestFlags::A,
21 &[
22 (TestFlags::A, 1),
23 (TestFlags::empty(), 1),
24 (TestFlags::B, 1 | 1 << 1),
25 ],
26 TestFlags::insert,
27 TestFlags::set,
28 );
29}
30
31#[track_caller]
32fn case<T: Flags + std::fmt::Debug + Copy>(

Callers

nothing calls this directly

Calls 1

caseFunction · 0.70

Tested by

no test coverage detected