body: Test the serialise function.
This commit is contained in:
parent
cebccb363f
commit
7002578bc0
1 changed files with 8 additions and 0 deletions
|
@ -29,6 +29,7 @@ mod tests {
|
||||||
use minidom::Element;
|
use minidom::Element;
|
||||||
use error::Error;
|
use error::Error;
|
||||||
use body;
|
use body;
|
||||||
|
use ns;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_simple() {
|
fn test_simple() {
|
||||||
|
@ -69,4 +70,11 @@ mod tests {
|
||||||
};
|
};
|
||||||
assert_eq!(message, "Unknown attribute in body element.");
|
assert_eq!(message, "Unknown attribute in body element.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_serialise() {
|
||||||
|
let body = body::Body::from("Hello world!");
|
||||||
|
let elem = body::serialise(&body);
|
||||||
|
assert!(elem.is("body", ns::JABBER_CLIENT));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue