We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
assert_xml_eq
1 parent 925a4e8 commit 3c45b5aCopy full SHA for 3c45b5a
schema/src/tests/utils.rs
@@ -1,6 +1,26 @@
1
+use xml::reader::XmlEvent;
2
+
3
pub fn assert_xml_eq(actual: &str, expected: &str) {
4
for (a, e) in without_whitespaces(actual).zip(without_whitespaces(expected)) {
- assert_eq!(a, e);
5
+ match (a, e) {
6
+ (
7
+ Ok(XmlEvent::StartDocument {
8
+ version,
9
+ encoding,
10
+ standalone,
11
+ }),
12
13
+ version: version_expected,
14
+ encoding: encoding_expected,
15
+ standalone: standalone_expected,
16
17
+ ) => {
18
+ assert_eq!(version, version_expected);
19
+ assert_eq!(encoding.to_lowercase(), encoding_expected.to_lowercase());
20
+ assert_eq!(standalone, standalone_expected);
21
+ }
22
+ (a, e) => assert_eq!(a, e),
23
24
}
25
26
0 commit comments