Commit 086d8e8 1 parent 662fc24 commit 086d8e8 Copy full SHA for 086d8e8
File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 3
3
//! Name each module / test as `issue<GH number>` and keep sorted by issue number
4
4
5
5
use quick_xml:: events:: { BytesStart , Event } ;
6
+ use quick_xml:: name:: QName ;
6
7
use quick_xml:: reader:: Reader ;
7
8
use quick_xml:: Error ;
8
9
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
+
9
23
/// Regression test for https://github.com/tafia/quick-xml/issues/514
10
24
mod issue514 {
11
25
use super :: * ;
You can’t perform that action at this time.
0 commit comments