update fuzz test
@@ -14,22 +14,31 @@ fuzz_target!(|data: &[u8]| {
loop {
match reader.read_event(&mut buf) {
Ok(Event::Start(ref e)) | Ok(Event::Empty(ref e))=> {
- if e.unescaped(&reader).is_err() {
+ if e.unescaped().is_err() {
break;
}
for a in e.attributes() {
- if a.and_then(|a| a.unescaped_value()).is_err() {
+ if a.ok().map_or(false, |a| a.unescaped_value().is_err()) {
break;
}
}
}
- Ok(Event::Text(ref e)) => {
- if e.unescaped(&reader).is_err() {
+ Ok(Event::Text(ref e)) | Ok(Event::Comment(ref e))
+ | Ok(Event::CData(ref e)) | Ok(Event::PI(ref e))
+ | Ok(Event::DocType(ref e)) => {
+ if e.unescaped().is_err() {
break;
}
}
+ Ok(Event::Decl(ref e)) => {
+ let _ = e.version();
+ let _ = e.encoding();
+ let _ = e.encoder();
+ let _ = e.standalone();
+ }
+ Ok(Event::End(_)) => (),
Ok(Event::Eof) | Err(..) => break,
- _ => buf.clear(),
}
+ buf.clear();
}
});
