aboutsummaryrefslogtreecommitdiff
path: root/b3sum
diff options
context:
space:
mode:
Diffstat (limited to 'b3sum')
-rw-r--r--b3sum/tests/cli_tests.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs
index f501ca6..cd48ac7 100644
--- a/b3sum/tests/cli_tests.rs
+++ b/b3sum/tests/cli_tests.rs
@@ -419,6 +419,24 @@ fn test_check() {
assert_eq!(expected_check_output, stdout);
assert_eq!("", stderr);
+ // Check the same file, but with Windows-style newlines.
+ let windows_style = expected_checkfile.replace("\n", "\r\n");
+ let output = cmd!(b3sum_exe(), "--check")
+ .stdin_bytes(windows_style.as_bytes())
+ .dir(dir.path())
+ .stdout_capture()
+ .stderr_capture()
+ .run()
+ .unwrap();
+ let stdout = std::str::from_utf8(&output.stdout).unwrap();
+ let stderr = std::str::from_utf8(&output.stderr).unwrap();
+ let expected_check_output = "\
+ a: OK\n\
+ b: OK\n\
+ c/d: OK\n";
+ assert_eq!(expected_check_output, stdout);
+ assert_eq!("", stderr);
+
// Now pass the same checkfile twice on the command line just for fun.
let checkfile_path = dir.path().join("checkfile");
fs::write(&checkfile_path, &expected_checkfile).unwrap();