From 94e0145d51dcd510df2e99944e94c23b033a536b Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 12 Jul 2021 12:54:39 -0700 Subject: [PATCH] fixes more minor issues --- src/uu/dd/cspell.json | 4 ++-- tests/by-util/test_dd.rs | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/uu/dd/cspell.json b/src/uu/dd/cspell.json index 9f4bd4207..fb29630b2 100644 --- a/src/uu/dd/cspell.json +++ b/src/uu/dd/cspell.json @@ -38,7 +38,7 @@ "ctty", ], "ignorePaths": [ - "**/test-fixtures/*.test", - "**/test-fixtures/*.spec" + "**/test-resources/*.test", + "**/test-resources/*.spec" ] } diff --git a/tests/by-util/test_dd.rs b/tests/by-util/test_dd.rs index 5e9014d39..de6e510a9 100644 --- a/tests/by-util/test_dd.rs +++ b/tests/by-util/test_dd.rs @@ -223,12 +223,12 @@ fn test_atime_updated() { let (fix, mut ucmd) = at_and_ucmd!(); ucmd.args(&["status=none", inf!(fname)]); - let pre_atime = fix.metadata(&fname).accessed().unwrap(); + let pre_atime = fix.metadata(fname).accessed().unwrap(); ucmd.pipe_in("").run().no_stderr().success(); std::thread::sleep(std::time::Duration::from_millis(10)); - let post_atime = fix.metadata(&fname).accessed().unwrap(); + let post_atime = fix.metadata(fname).accessed().unwrap(); assert!(pre_atime != post_atime); } @@ -240,11 +240,11 @@ fn test_noatime_does_not_update_infile_atime() { let (fix, mut ucmd) = at_and_ucmd!(); ucmd.args(&["status=none", "iflag=noatime", inf!(fname)]); - let pre_atime = fix.metadata(&fname).accessed().unwrap(); + let pre_atime = fix.metadata(fname).accessed().unwrap(); ucmd.run().no_stderr().success(); - let post_atime = fix.metadata(&fname).accessed().unwrap(); + let post_atime = fix.metadata(fname).accessed().unwrap(); assert_eq!(pre_atime, post_atime); } @@ -256,11 +256,11 @@ fn test_noatime_does_not_update_ofile_atime() { let (fix, mut ucmd) = at_and_ucmd!(); ucmd.args(&["status=none", "oflag=noatime", of!(fname)]); - let pre_atime = fix.metadata(&fname).accessed().unwrap(); + let pre_atime = fix.metadata(fname).accessed().unwrap(); ucmd.pipe_in("").run().no_stderr().success(); - let post_atime = fix.metadata(&fname).accessed().unwrap(); + let post_atime = fix.metadata(fname).accessed().unwrap(); assert_eq!(pre_atime, post_atime); } @@ -274,7 +274,7 @@ fn test_nocreat_causes_failure_when_outfile_not_present() { .pipe_in("") .fails() .stderr_is("dd Error: No such file or directory (os error 2)"); - assert!(!fix.file_exists(&fname)); + assert!(!fix.file_exists(fname)); } #[test] @@ -294,7 +294,7 @@ fn test_notrunc_does_not_truncate() { .no_stderr() .success(); - assert_eq!(256, fix.metadata(&fname).len()); + assert_eq!(256, fix.metadata(fname).len()); } #[test] @@ -314,7 +314,7 @@ fn test_existing_file_truncated() { .no_stderr() .success(); - assert_eq!(0, fix.metadata(&fname).len()); + assert_eq!(0, fix.metadata(fname).len()); } #[test] @@ -501,7 +501,7 @@ fn test_ascii_521k_to_file() { cmp_file!( { let mut input_f = tempfile().unwrap(); - input_f.write(&input).unwrap(); + input_f.write_all(&input).unwrap(); input_f }, fix.open(&tmp_fn) @@ -521,7 +521,7 @@ fn test_ascii_5_gibi_to_file() { "count=5G", "iflag=count_bytes", "if=/dev/zero", - of!(tmp_fn) + of!(tmp_fn), ]) .run() .no_stderr()