File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,24 @@ fn test_check() {
419419 assert_eq ! ( expected_check_output, stdout) ;
420420 assert_eq ! ( "" , stderr) ;
421421
422+ // Check the same file, but with Windows-style newlines.
423+ let windows_style = expected_checkfile. replace ( "\n " , "\r \n " ) ;
424+ let output = cmd ! ( b3sum_exe( ) , "--check" )
425+ . stdin_bytes ( windows_style. as_bytes ( ) )
426+ . dir ( dir. path ( ) )
427+ . stdout_capture ( )
428+ . stderr_capture ( )
429+ . run ( )
430+ . unwrap ( ) ;
431+ let stdout = std:: str:: from_utf8 ( & output. stdout ) . unwrap ( ) ;
432+ let stderr = std:: str:: from_utf8 ( & output. stderr ) . unwrap ( ) ;
433+ let expected_check_output = "\
434+ a: OK\n \
435+ b: OK\n \
436+ c/d: OK\n ";
437+ assert_eq ! ( expected_check_output, stdout) ;
438+ assert_eq ! ( "" , stderr) ;
439+
422440 // Now pass the same checkfile twice on the command line just for fun.
423441 let checkfile_path = dir. path ( ) . join ( "checkfile" ) ;
424442 fs:: write ( & checkfile_path, & expected_checkfile) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments