Skip to content

Commit 4b5a422

Browse files
committed
Extend fuzz target to also do serialization.
1 parent ebd789f commit 4b5a422

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fuzz/fuzzers/parse.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ use std::str;
55

66
fuzz_target!(|data: &[u8]| {
77
if let Ok(utf8) = str::from_utf8(data) {
8-
let _ = url::Url::parse(utf8);
8+
if let Ok(parsed) = url::Url::parse(utf8) {
9+
let as_str = parsed.as_str();
10+
assert_eq!(parsed, url::Url::parse(as_str).unwrap());
11+
}
912
}
1013
});

0 commit comments

Comments
 (0)