Skip to content

Commit

Permalink
Add regression test for tafia#622
Browse files Browse the repository at this point in the history
failures:
    issue622
  • Loading branch information
Mingun committed Nov 12, 2023
1 parent d6f7d15 commit 2b4c4ae
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

use std::sync::mpsc;

use quick_xml::errors::{IllFormedError, SyntaxError};
use quick_xml::errors::{Error, IllFormedError, SyntaxError};
use quick_xml::events::{BytesDecl, BytesStart, BytesText, Event};
use quick_xml::name::QName;
use quick_xml::reader::Reader;
use quick_xml::Error;

/// Regression test for https://github.com/tafia/quick-xml/issues/94
#[test]
Expand Down Expand Up @@ -231,3 +230,19 @@ mod issue604 {
assert_eq!(reader.read_event_into(&mut buf).unwrap(), Event::Eof);
}
}

/// Regression test for https://github.com/tafia/quick-xml/issues/622
#[test]
fn issue622() {
let mut reader = Reader::from_str("><");
reader.config_mut().trim_text(true);

assert_eq!(
reader.read_event().unwrap(),
Event::Text(BytesText::from_escaped(">"))
);
match reader.read_event() {
Err(Error::Syntax(cause)) => assert_eq!(cause, SyntaxError::UnclosedTag),
x => panic!("Expected `Err(Syntax(_))`, but got `{:?}`", x),
}
}

0 comments on commit 2b4c4ae

Please sign in to comment.