File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 33//! Name each module / test as `issue<GH number>` and keep sorted by issue number
44
55use quick_xml:: events:: { BytesStart , Event } ;
6+ use quick_xml:: name:: QName ;
67use quick_xml:: reader:: Reader ;
78use quick_xml:: Error ;
89
10+ /// Regression test for https://github.com/tafia/quick-xml/issues/115
11+ #[ test]
12+ fn issue115 ( ) {
13+ let mut r = Reader :: from_str ( "<tag1 attr1='line 1\n line 2'></tag1>" ) ;
14+ match r. read_event ( ) {
15+ Ok ( Event :: Start ( e) ) if e. name ( ) == QName ( b"tag1" ) => {
16+ let v = e. attributes ( ) . map ( |a| a. unwrap ( ) . value ) . collect :: < Vec < _ > > ( ) ;
17+ assert_eq ! ( v[ 0 ] . clone( ) . into_owned( ) , b"line 1\n line 2" ) ;
18+ }
19+ _ => ( ) ,
20+ }
21+ }
22+
923/// Regression test for https://github.com/tafia/quick-xml/issues/514
1024mod issue514 {
1125 use super :: * ;
You can’t perform that action at this time.
0 commit comments