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

Function roundtrip_truncate

src/tests/parser.rs:24–40  ·  view source on GitHub ↗

Very slow in miri

()

Source from the content-addressed store, hash-verified

22#[test]
23#[cfg(not(miri))] // Very slow in miri
24fn roundtrip_truncate() {
25 let mut s = String::new();
26
27 for a in 0u8..=255 {
28 for b in 0u8..=255 {
29 let f = TestFlags::from_bits_retain(a | b);
30
31 s.clear();
32 to_writer_truncate(&f, &mut s).unwrap();
33
34 assert_eq!(
35 TestFlags::from_bits_truncate(f.bits()),
36 from_str_truncate::<TestFlags>(&s).unwrap()
37 );
38 }
39 }
40}
41
42#[test]
43#[cfg(not(miri))] // Very slow in miri

Callers

nothing calls this directly

Calls 2

to_writer_truncateFunction · 0.85
clearMethod · 0.80

Tested by

no test coverage detected