parsers: add xso test module
Maxime “pep” Buquet
created 1 year ago
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>
Change summary
parsers/src/util/macro_tests.rs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
Detailed changes
@@ -46,7 +46,7 @@ mod helpers {
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
// unqualified names in the macro expansions.
@@ -2191,3 +2191,12 @@ fn flag_absent_roundtrip() {
};
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>");
+}