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

Function invalid

src/tests/parser.rs:103–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102 #[test]
103 fn invalid() {
104 assert!(from_str::<TestFlags>("a")
105 .unwrap_err()
106 .to_string()
107 .starts_with("unrecognized named flag"));
108 assert!(from_str::<TestFlags>("A & B")
109 .unwrap_err()
110 .to_string()
111 .starts_with("unrecognized named flag"));
112
113 assert!(from_str::<TestFlags>("0xg")
114 .unwrap_err()
115 .to_string()
116 .starts_with("invalid hex flag"));
117 assert!(from_str::<TestFlags>("0xffffffffffff")
118 .unwrap_err()
119 .to_string()
120 .starts_with("invalid hex flag"));
121 }
122}
123
124mod to_writer {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected