1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
University of Edinburgh XML 1.0 4th edition errata test suite.
*/
#[cfg(all(test, feature = "test-conformance-xml"))]
use std::fs;
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::item::Node;
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::parser::{ParseError, xml};
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::trees::smite::RNode;
#[cfg(all(test, feature = "test-conformance-xml"))]
fn test_eduni_errata4e_error(xmldoc: &str) {
let testxml = RNode::new_document();
let parseresult = xml::parse(
testxml,
xmldoc,
Some(|_: &_| Err(ParseError::MissingNameSpace)),
);
assert!(parseresult.is_err());
}
#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn invalidbo7() {
/*
Test ID:invalid-bo-7
Test URI:inclbomboom_be.xml
Spec Sections:4.3.3
Description:A byte order mark and a backwards one in general entity cause an illegal char. error (big-endian)
*/
test_eduni_errata4e_error(
fs::read_to_string("tests/conformance/xml/xmlconf/eduni/errata-4e/inclbomboom_be.xml")
.unwrap()
.as_str(),
);
}
#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn invalidbo8() {
/*
Test ID:invalid-bo-8
Test URI:inclbomboom_le.xml
Spec Sections:4.3.3
Description:A byte order mark and a backwards one in general entity cause an illegal char. error (little-endian)
*/
test_eduni_errata4e_error(
fs::read_to_string("tests/conformance/xml/xmlconf/eduni/errata-4e/inclbomboom_le.xml")
.unwrap()
.as_str(),
);
}
#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn invalidbo9() {
/*
Test ID:invalid-bo-9
Test URI:incl8bomboom.xml
Spec Sections:4.3.3
Description:A byte order mark and a backwards one in general entity cause an illegal char. error (utf-8)
*/
test_eduni_errata4e_error(
fs::read_to_string("tests/conformance/xml/xmlconf/eduni/errata-4e/incl8bomboom.xml")
.unwrap()
.as_str(),
);
}
/*
#[test]
#[ignore]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn xrmt008() {
/*
This test is deliberately ignored.
In 5th edition, any document number other than 1.1 is treated as a 1.0 document.
*/
/*
Test ID:x-rmt-008
Test URI:008.xml
Spec Sections:2.8 4.3.4
Description:a document with version=1.7, illegal in XML 1.0 through 4th edition
*/
test_eduni_errata4e_error(
fs::read_to_string("tests/conformance/xml/xmlconf/eduni/errata-4e/008.xml")
.unwrap()
.as_str());
}
*/