Add more tests.
This commit is contained in:
parent
40e9e785b9
commit
c146776e8b
|
@ -0,0 +1,11 @@
|
|||
use opml::OPML;
|
||||
|
||||
#[test]
|
||||
#[allow(deprecated)]
|
||||
fn test_deprecated_functions() {
|
||||
let xml = r#"<opml version="2.0"><head/><body><outline text="Outline"/></body></opml>"#;
|
||||
let document = OPML::new(xml).unwrap();
|
||||
|
||||
assert_eq!(document.version, "2.0");
|
||||
assert!(document.to_xml().is_ok());
|
||||
}
|
|
@ -99,3 +99,17 @@ fn test_valid_opml_1_0() {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_valid_from_reader() {
|
||||
let xml = r#"<opml version="2.0"><head/><body><outline text="Outline"/></body></opml>"#;
|
||||
assert!(OPML::from_reader(&mut xml.as_bytes()).is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_valid_to_writer() {
|
||||
let document = OPML::default();
|
||||
let mut writer = vec![];
|
||||
assert!(document.to_writer(&mut writer).is_ok());
|
||||
assert!(!writer.is_empty());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue