Merge branch 'linkmauve/minidom-rs-failure'

# Conflicts:
#	src/tests.rs
This commit is contained in:
lumi 2018-02-18 21:32:51 +01:00
commit 8924d2d594
6 changed files with 83 additions and 40 deletions

View file

@ -226,3 +226,24 @@ fn write_comments() {
}
assert_eq!(String::from_utf8(writer).unwrap(), COMMENT_TEST_STRING);
}
#[test]
fn xml_error() {
match "<a></b>".parse::<Element>() {
Err(::error::Error::XmlError(_)) => (),
err => panic!("No or wrong error: {:?}", err)
}
match "<a></".parse::<Element>() {
Err(::error::Error::XmlError(_)) => (),
err => panic!("No or wrong error: {:?}", err)
}
}
#[test]
fn invalid_element_error() {
match "<a:b:c>".parse::<Element>() {
Err(::error::Error::InvalidElement) => (),
err => panic!("No or wrong error: {:?}", err)
}
}