mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 20:17:45 +00:00
fxi tests for unittests in dd and hashsum
This commit is contained in:
parent
a4737c0b50
commit
094bb61a63
2 changed files with 8 additions and 8 deletions
|
@ -303,10 +303,10 @@ fn test_status_level_noxfer() {
|
|||
fn test_multiple_flags_options() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--iflag=fullblock,directory"),
|
||||
String::from("--iflag=fullblock,count_bytes"),
|
||||
String::from("--iflag=skip_bytes"),
|
||||
String::from("--oflag=direct"),
|
||||
String::from("--oflag=dsync"),
|
||||
String::from("--oflag=append"),
|
||||
String::from("--oflag=seek_bytes"),
|
||||
String::from("--conv=ascii,ucase"),
|
||||
String::from("--conv=unblock"),
|
||||
];
|
||||
|
@ -315,13 +315,13 @@ fn test_multiple_flags_options() {
|
|||
// iflag
|
||||
let iflags = parse_flag_list::<Flag>(options::IFLAG, &matches).unwrap();
|
||||
assert_eq!(
|
||||
vec![Flag::FullBlock, Flag::Directory, Flag::SkipBytes],
|
||||
vec![Flag::FullBlock, Flag::CountBytes, Flag::SkipBytes],
|
||||
iflags
|
||||
);
|
||||
|
||||
// oflag
|
||||
let oflags = parse_flag_list::<Flag>(options::OFLAG, &matches).unwrap();
|
||||
assert_eq!(vec![Flag::Direct, Flag::Dsync], oflags);
|
||||
assert_eq!(vec![Flag::Append, Flag::SeekBytes], oflags);
|
||||
|
||||
// conv
|
||||
let conv = parse_flag_list::<ConvFlag>(options::CONV, &matches).unwrap();
|
||||
|
@ -685,7 +685,7 @@ mod test_64bit_arch {
|
|||
#[test]
|
||||
#[should_panic]
|
||||
fn test_overflow_panic() {
|
||||
let bs_str = format!("{}KiB", usize::MAX);
|
||||
let bs_str = format!("{}KiB", u64::MAX);
|
||||
|
||||
parse_bytes_with_opt_multiplier(&bs_str).unwrap();
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ mod tests {
|
|||
use crate::digest::DigestWriter;
|
||||
|
||||
// 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::Md5::new()) as Box<dyn Digest>;
|
||||
let mut writer_crlf = DigestWriter::new(&mut digest, false);
|
||||
writer_crlf.write_all(&[b'\r']).unwrap();
|
||||
writer_crlf.write_all(&[b'\n']).unwrap();
|
||||
|
@ -282,7 +282,7 @@ mod tests {
|
|||
let result_crlf = digest.result_str();
|
||||
|
||||
// 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::Md5::new()) as Box<dyn Digest>;
|
||||
let mut writer_lf = DigestWriter::new(&mut digest, false);
|
||||
writer_lf.write_all(&[b'\n']).unwrap();
|
||||
writer_lf.finalize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue