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

Function cases

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

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 case(true, TestFlags::empty(), TestFlags::is_empty);
8
9 case(false, TestFlags::A, TestFlags::is_empty);
10 case(false, TestFlags::ABC, TestFlags::is_empty);
11 case(
12 false,
13 TestFlags::from_bits_retain(1 << 3),
14 TestFlags::is_empty,
15 );
16
17 case(true, TestZero::empty(), TestZero::is_empty);
18
19 case(true, TestEmpty::empty(), TestEmpty::is_empty);
20}
21
22#[track_caller]
23fn 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