@@ -8,7 +8,7 @@ use std::path::{Path, PathBuf};
8
8
use std:: process:: { Command , Stdio } ;
9
9
use std:: str:: Chars ;
10
10
11
- use crate :: config:: { Color , Config , EmitMode , FileName , ReportTactic } ;
11
+ use crate :: config:: { Color , Config , EmitMode , FileName , NewlineStyle , ReportTactic } ;
12
12
use crate :: formatting:: { ReportedErrors , SourceFile } ;
13
13
use crate :: rustfmt_diff:: { make_diff, print_diff, DiffLine , Mismatch , ModifiedChunk , OutputWriter } ;
14
14
use crate :: source_file;
@@ -299,6 +299,7 @@ fn stdin_works_with_modified_lines() {
299
299
300
300
let input = Input :: Text ( input. to_owned ( ) ) ;
301
301
let mut config = Config :: default ( ) ;
302
+ config. set ( ) . newline_style ( NewlineStyle :: Unix ) ;
302
303
config. set ( ) . emit_mode ( EmitMode :: ModifiedLines ) ;
303
304
let mut buf: Vec < u8 > = vec ! [ ] ;
304
305
{
@@ -310,8 +311,7 @@ fn stdin_works_with_modified_lines() {
310
311
} ;
311
312
assert_eq ! ( session. errors, errors) ;
312
313
}
313
- let newline = if cfg ! ( windows) { "\r \n " } else { "\n " } ;
314
- assert_eq ! ( buf, output. replace( '\n' , newline) . as_bytes( ) ) ;
314
+ assert_eq ! ( buf, output. as_bytes( ) ) ;
315
315
}
316
316
317
317
#[ test]
0 commit comments