Skip to content

Commit

Permalink
Remove excess tests from xmlrs_reader_tests.rs
Browse files Browse the repository at this point in the history
The following tests in xmlrs_reader_tests.rs already checked by tests in reader-namespaces.rs:
- issue_attributes_have_no_default_namespace   - default_ns_shadowing_empty
- default_namespace_applies_to_end_elem        - default_namespace

The following tests in xmlrs_reader_tests.rs already checked by unit tests src/events/attributes.rs:
- issue_83_duplicate_attributes - `duplicated` modules
  • Loading branch information
Mingun committed Jun 19, 2024
1 parent a7ee294 commit c49ead8
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions tests/xmlrs_reader_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,6 @@ fn tabs_1() {
);
}

#[test]
fn issue_83_duplicate_attributes() {
// Error when parsing attributes won't stop main event reader
// as it is a lazy operation => add ending events
test(
r#"<hello><some-tag a='10' a="20"/></hello>"#,
"
|StartElement(hello)
|1:30 EmptyElement(some-tag, attr-error: \
position 16: duplicated attribute, previous declaration at position 9)
|EndElement(hello)
|EndDocument
",
true,
);
}

#[test]
fn issue_93_large_characters_in_entity_references() {
test(
Expand Down Expand Up @@ -284,20 +267,6 @@ fn issue_105_unexpected_double_dash() {
);
}

#[test]
fn issue_attributes_have_no_default_namespace() {
// At the moment, the 'test' method doesn't render namespaces for attribute names.
// This test only checks whether the default namespace got applied to the EmptyElement.
test(
r#"<hello xmlns="urn:foo" x="y"/>"#,
r#"
|EmptyElement({urn:foo}hello [x="y"])
|EndDocument
"#,
true,
);
}

#[test]
fn issue_default_namespace_on_outermost_element() {
// Regression test
Expand All @@ -311,22 +280,6 @@ fn issue_default_namespace_on_outermost_element() {
);
}

#[test]
fn default_namespace_applies_to_end_elem() {
test(
r#"<hello xmlns="urn:foo" x="y">
<inner/>
</hello>"#,
r#"
|StartElement({urn:foo}hello [x="y"])
|EmptyElement({urn:foo}inner)
|EndElement({urn:foo}hello)
|EndDocument
"#,
true,
);
}

#[track_caller]
fn test(input: &str, output: &str, trim: bool) {
test_bytes(input.as_bytes(), output.as_bytes(), trim);
Expand Down

0 comments on commit c49ead8

Please sign in to comment.