@@ -355,21 +355,15 @@ fn default_namespace_applies_to_end_elem() {
355355}
356356
357357#[ track_caller]
358- fn test ( input : & str , output : & str , is_short : bool ) {
359- test_bytes ( input. as_bytes ( ) , output. as_bytes ( ) , is_short ) ;
358+ fn test ( input : & str , output : & str , trim : bool ) {
359+ test_bytes ( input. as_bytes ( ) , output. as_bytes ( ) , trim ) ;
360360}
361361
362362#[ track_caller]
363- fn test_bytes ( input : & [ u8 ] , output : & [ u8 ] , is_short : bool ) {
364- // Normalize newlines on Windows to just \n, which is what the reader and
365- // writer use.
366- // let input = input.replace("\r\n", "\n");
367- // let input = input.as_bytes();
368- // let output = output.replace("\r\n", "\n");
369- // let output = output.as_bytes();
363+ fn test_bytes ( input : & [ u8 ] , output : & [ u8 ] , trim : bool ) {
370364 let mut reader = Reader :: from_reader ( input) ;
371365 reader
372- . trim_text ( is_short )
366+ . trim_text ( trim )
373367 . check_comments ( true )
374368 . expand_empty_elements ( false ) ;
375369
@@ -402,20 +396,6 @@ fn test_bytes(input: &[u8], output: &[u8], is_short: bool) {
402396 }
403397 panic ! ( "Unexpected event: {}" , line) ;
404398 }
405-
406- if !is_short && line. starts_with ( "StartDocument" ) {
407- // advance next Characters(empty space) ...
408- if let Ok ( Event :: Text ( ref e) ) = reader. read_event ( & mut Vec :: new ( ) ) {
409- if e. iter ( ) . any ( |b| match * b {
410- b' ' | b'\r' | b'\n' | b'\t' => false ,
411- _ => true ,
412- } ) {
413- panic ! ( "Reader expects empty Text event after a StartDocument" ) ;
414- }
415- } else {
416- panic ! ( "Reader expects empty Text event after a StartDocument" ) ;
417- }
418- }
419399 }
420400}
421401
0 commit comments