2020-05-24 13:31:17 +00:00
|
|
|
use std::fs::read_to_string as read;
|
2020-05-23 12:32:40 +00:00
|
|
|
|
|
|
|
use opml::*;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn test_invalid_xml() {
|
2020-05-24 13:31:17 +00:00
|
|
|
let sample = read("tests/samples/invalid_xml.opml").unwrap();
|
|
|
|
OPML::new(sample.as_str()).unwrap();
|
2020-05-23 12:32:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic(expected = "Unsupported OPML version detected: invalid")]
|
|
|
|
fn test_invalid_opml_version() {
|
2020-05-24 13:31:17 +00:00
|
|
|
let sample = read("tests/samples/invalid_opml_version.opml").unwrap();
|
|
|
|
OPML::new(sample.as_str()).unwrap();
|
2020-05-23 12:32:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic(expected = "OPML body has no outlines.")]
|
|
|
|
fn test_invalid_opml_no_outlines() {
|
2020-05-24 13:31:17 +00:00
|
|
|
let sample = read("tests/samples/invalid_opml_no_outlines.opml").unwrap();
|
|
|
|
OPML::new(sample.as_str()).unwrap();
|
2020-05-23 12:32:40 +00:00
|
|
|
}
|