Skip to content

Commit

Permalink
Add regression test for tafia#360
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Jan 8, 2023
1 parent aeea614 commit 97d5ff5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Name each module / test as `issue<GH number>` and keep sorted by issue number

use std::sync::mpsc;

use quick_xml::events::{BytesStart, Event};
use quick_xml::name::QName;
use quick_xml::reader::Reader;
Expand All @@ -20,6 +22,28 @@ fn issue115() {
}
}

/// Regression test for https://github.com/tafia/quick-xml/issues/360
#[test]
fn issue360() {
let (tx, rx) = mpsc::channel::<Event>();

std::thread::spawn(move || {
let mut r = Reader::from_str("<tag1 attr1='line 1\nline 2'></tag1>");
loop {
let event = r.read_event().unwrap();
if event == Event::Eof {
tx.send(event).unwrap();
break;
} else {
tx.send(event).unwrap();
}
}
});
for event in rx.iter() {
println!("{:?}", event);
}
}

/// Regression test for https://github.com/tafia/quick-xml/issues/514
mod issue514 {
use super::*;
Expand Down

0 comments on commit 97d5ff5

Please sign in to comment.