mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 02:08:09 +00:00
fixup! hashsum: fix handling of \r\n in Windows text mode
This commit is contained in:
parent
c50b5ac110
commit
d1e02665bf
1 changed files with 3 additions and 3 deletions
|
@ -297,15 +297,15 @@ mod tests {
|
||||||
// Writing "\r" in one call to `write()`, and then "\n" in another.
|
// Writing "\r" in one call to `write()`, and then "\n" in another.
|
||||||
let mut digest = Box::new(md5::Context::new()) as Box<dyn Digest>;
|
let mut digest = Box::new(md5::Context::new()) as Box<dyn Digest>;
|
||||||
let mut writer_crlf = DigestWriter::new(&mut digest, false);
|
let mut writer_crlf = DigestWriter::new(&mut digest, false);
|
||||||
writer_crlf.write(&[b'\r']).unwrap();
|
writer_crlf.write_all(&[b'\r']).unwrap();
|
||||||
writer_crlf.write(&[b'\n']).unwrap();
|
writer_crlf.write_all(&[b'\n']).unwrap();
|
||||||
writer_crlf.finalize();
|
writer_crlf.finalize();
|
||||||
let result_crlf = digest.result_str();
|
let result_crlf = digest.result_str();
|
||||||
|
|
||||||
// We expect "\r\n" to be replaced with "\n" in text mode on Windows.
|
// We expect "\r\n" to be replaced with "\n" in text mode on Windows.
|
||||||
let mut digest = Box::new(md5::Context::new()) as Box<dyn Digest>;
|
let mut digest = Box::new(md5::Context::new()) as Box<dyn Digest>;
|
||||||
let mut writer_lf = DigestWriter::new(&mut digest, false);
|
let mut writer_lf = DigestWriter::new(&mut digest, false);
|
||||||
writer_lf.write(&[b'\n']).unwrap();
|
writer_lf.write_all(&[b'\n']).unwrap();
|
||||||
writer_lf.finalize();
|
writer_lf.finalize();
|
||||||
let result_lf = digest.result_str();
|
let result_lf = digest.result_str();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue