parsers: add xso test module
Separate from the macro_tests module because it doesn't actually test macros, it uses it as a convenience. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
b89d3ab04d
commit
947d84c0d2
1 changed files with 10 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ mod helpers {
|
||||||
|
|
||||||
use self::helpers::{parse_str, roundtrip_full};
|
use self::helpers::{parse_str, roundtrip_full};
|
||||||
|
|
||||||
use xso::{AsXml, FromXml};
|
use xso::{AsXml, FromXml, PrintRawXml};
|
||||||
|
|
||||||
// these are adverserial local names in order to trigger any issues with
|
// these are adverserial local names in order to trigger any issues with
|
||||||
// unqualified names in the macro expansions.
|
// unqualified names in the macro expansions.
|
||||||
|
|
@ -2191,3 +2191,12 @@ fn flag_absent_roundtrip() {
|
||||||
};
|
};
|
||||||
roundtrip_full::<Flag>("<foo xmlns='urn:example:ns1'/>");
|
roundtrip_full::<Flag>("<foo xmlns='urn:example:ns1'/>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn printrawxml() {
|
||||||
|
let text = TextString {
|
||||||
|
text: String::from("hello world"),
|
||||||
|
};
|
||||||
|
let display = format!("{}", PrintRawXml(&text));
|
||||||
|
assert_eq!(display, "<text xmlns='urn:example:ns1'>hello world</text>");
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue