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

Function cases

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

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 case(0, TestFlags::empty(), TestFlags::bits);
8
9 case(1, TestFlags::A, TestFlags::bits);
10 case(1 | 1 << 1 | 1 << 2, TestFlags::ABC, TestFlags::bits);
11
12 case(!0, TestFlags::from_bits_retain(u8::MAX), TestFlags::bits);
13 case(1 << 3, TestFlags::from_bits_retain(1 << 3), TestFlags::bits);
14
15 case(1 << 3, TestZero::from_bits_retain(1 << 3), TestZero::bits);
16
17 case(1 << 3, TestEmpty::from_bits_retain(1 << 3), TestEmpty::bits);
18
19 case(
20 1 << 4 | 1 << 6,
21 TestExternal::from_bits_retain(1 << 4 | 1 << 6),
22 TestExternal::bits,
23 );
24}
25
26#[track_caller]
27fn case<T: Flags + std::fmt::Debug>(

Callers

nothing calls this directly

Calls 1

caseFunction · 0.70

Tested by

no test coverage detected