aboutsummaryrefslogtreecommitdiff
path: root/b3sum
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2024-11-26 18:38:04 -0800
committerJack O'Connor <[email protected]>2024-11-26 18:38:04 -0800
commit5c8b350b3531102359b89e9f0a3367e6de4a43f4 (patch)
treeba0664f6176d34db8fd1721fe184a527b83b4ddf /b3sum
parent81f772a4cd70dc0325047a6a737d2f6f4b92180e (diff)
another Windows-style newlines test
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();