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

Function roundtrip

src/tests/iter.rs:7–23  ·  view source on GitHub ↗

Very slow in miri

()

Source from the content-addressed store, hash-verified

5#[test]
6#[cfg(not(miri))] // Very slow in miri
7fn roundtrip() {
8 for a in 0u8..=255 {
9 for b in 0u8..=255 {
10 let f = TestFlags::from_bits_retain(a | b);
11
12 assert_eq!(f, f.iter().collect::<TestFlags>());
13 assert_eq!(
14 TestFlags::from_bits_truncate(f.bits()),
15 f.iter_names().map(|(_, f)| f).collect::<TestFlags>()
16 );
17
18 let f = TestExternal::from_bits_retain(a | b);
19
20 assert_eq!(f, f.iter().collect::<TestExternal>());
21 }
22 }
23}
24
25mod collect {
26 use super::*;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected