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

Function cases

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

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 let flags = TestFlags::FLAGS
8 .iter()
9 .map(|flag| (flag.name(), flag.value().bits()))
10 .collect::<Vec<_>>();
11
12 assert_eq!(
13 vec![
14 ("A", 1u8),
15 ("B", 1 << 1),
16 ("C", 1 << 2),
17 ("ABC", 1 | 1 << 1 | 1 << 2),
18 ],
19 flags,
20 );
21
22 assert_eq!(0, TestEmpty::FLAGS.iter().count());
23}
24
25mod external {
26 use super::*;

Callers

nothing calls this directly

Calls 4

iterMethod · 0.80
nameMethod · 0.80
valueMethod · 0.80
bitsMethod · 0.45

Tested by

no test coverage detected