Skip to content

Commit 5c8b350

Browse files
committed
another Windows-style newlines test
1 parent 81f772a commit 5c8b350

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

b3sum/tests/cli_tests.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)