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

Function roundtrip

src/tests/parser.rs:7–20  ·  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 let mut s = String::new();
9
10 for a in 0u8..=255 {
11 for b in 0u8..=255 {
12 let f = TestFlags::from_bits_retain(a | b);
13
14 s.clear();
15 to_writer(&f, &mut s).unwrap();
16
17 assert_eq!(f, from_str::<TestFlags>(&s).unwrap());
18 }
19 }
20}
21
22#[test]
23#[cfg(not(miri))] // Very slow in miri

Callers

nothing calls this directly

Calls 2

to_writerFunction · 0.85
clearMethod · 0.80

Tested by

no test coverage detected