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

Function roundtrip_strict

src/tests/parser.rs:44–65  ·  view source on GitHub ↗

Very slow in miri

()

Source from the content-addressed store, hash-verified

42#[test]
43#[cfg(not(miri))] // Very slow in miri
44fn roundtrip_strict() {
45 let mut s = String::new();
46
47 for a in 0u8..=255 {
48 for b in 0u8..=255 {
49 let f = TestFlags::from_bits_retain(a | b);
50
51 s.clear();
52 to_writer_strict(&f, &mut s).unwrap();
53
54 let mut strict = TestFlags::empty();
55 for (_, flag) in f.iter_names() {
56 strict |= flag;
57 }
58 let f = strict;
59
60 if let Ok(s) = from_str_strict::<TestFlags>(&s) {
61 assert_eq!(f, s);
62 }
63 }
64 }
65}
66
67mod from_str {
68 use super::*;

Callers

nothing calls this directly

Calls 3

to_writer_strictFunction · 0.85
clearMethod · 0.80
iter_namesMethod · 0.80

Tested by

no test coverage detected