mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests ~ fix cargo clippy
complaint (clippy::needless_borrow)
This commit is contained in:
parent
8f0d42da39
commit
0dc8c18bac
4 changed files with 21 additions and 21 deletions
|
@ -438,7 +438,7 @@ fn test_domain_socket() {
|
|||
let child = new_ucmd!().args(&[socket_path]).run_no_wait();
|
||||
barrier.wait();
|
||||
let stdout = &child.wait_with_output().unwrap().stdout;
|
||||
let output = String::from_utf8_lossy(&stdout);
|
||||
let output = String::from_utf8_lossy(stdout);
|
||||
assert_eq!("a\tb", output);
|
||||
|
||||
thread.join().unwrap();
|
||||
|
|
|
@ -618,7 +618,7 @@ fn test_cp_deref() {
|
|||
// Check the content of the destination file that was copied.
|
||||
assert_eq!(at.read(TEST_COPY_TO_FOLDER_FILE), "Hello, World!\n");
|
||||
let path_to_check = path_to_new_symlink.to_str().unwrap();
|
||||
assert_eq!(at.read(&path_to_check), "Hello, World!\n");
|
||||
assert_eq!(at.read(path_to_check), "Hello, World!\n");
|
||||
}
|
||||
#[test]
|
||||
fn test_cp_no_deref() {
|
||||
|
@ -655,7 +655,7 @@ fn test_cp_no_deref() {
|
|||
// Check the content of the destination file that was copied.
|
||||
assert_eq!(at.read(TEST_COPY_TO_FOLDER_FILE), "Hello, World!\n");
|
||||
let path_to_check = path_to_new_symlink.to_str().unwrap();
|
||||
assert_eq!(at.read(&path_to_check), "Hello, World!\n");
|
||||
assert_eq!(at.read(path_to_check), "Hello, World!\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -823,7 +823,7 @@ fn test_cp_deref_folder_to_folder() {
|
|||
|
||||
// Check the content of the symlink
|
||||
let path_to_check = path_to_new_symlink.to_str().unwrap();
|
||||
assert_eq!(at.read(&path_to_check), "Hello, World!\n");
|
||||
assert_eq!(at.read(path_to_check), "Hello, World!\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -923,7 +923,7 @@ fn test_cp_no_deref_folder_to_folder() {
|
|||
|
||||
// Check the content of the symlink
|
||||
let path_to_check = path_to_new_symlink.to_str().unwrap();
|
||||
assert_eq!(at.read(&path_to_check), "Hello, World!\n");
|
||||
assert_eq!(at.read(path_to_check), "Hello, World!\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -398,7 +398,7 @@ fn test_ls_long_formats() {
|
|||
.arg("--author")
|
||||
.arg("test-long-formats")
|
||||
.succeeds();
|
||||
assert!(re_three.is_match(&result.stdout_str()));
|
||||
assert!(re_three.is_match(result.stdout_str()));
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
|
@ -701,20 +701,20 @@ fn test_ls_styles() {
|
|||
.arg("-l")
|
||||
.arg("--time-style=full-iso")
|
||||
.succeeds();
|
||||
assert!(re_full.is_match(&result.stdout_str()));
|
||||
assert!(re_full.is_match(result.stdout_str()));
|
||||
//long-iso
|
||||
let result = scene
|
||||
.ucmd()
|
||||
.arg("-l")
|
||||
.arg("--time-style=long-iso")
|
||||
.succeeds();
|
||||
assert!(re_long.is_match(&result.stdout_str()));
|
||||
assert!(re_long.is_match(result.stdout_str()));
|
||||
//iso
|
||||
let result = scene.ucmd().arg("-l").arg("--time-style=iso").succeeds();
|
||||
assert!(re_iso.is_match(&result.stdout_str()));
|
||||
assert!(re_iso.is_match(result.stdout_str()));
|
||||
//locale
|
||||
let result = scene.ucmd().arg("-l").arg("--time-style=locale").succeeds();
|
||||
assert!(re_locale.is_match(&result.stdout_str()));
|
||||
assert!(re_locale.is_match(result.stdout_str()));
|
||||
|
||||
//Overwrite options tests
|
||||
let result = scene
|
||||
|
@ -723,19 +723,19 @@ fn test_ls_styles() {
|
|||
.arg("--time-style=long-iso")
|
||||
.arg("--time-style=iso")
|
||||
.succeeds();
|
||||
assert!(re_iso.is_match(&result.stdout_str()));
|
||||
assert!(re_iso.is_match(result.stdout_str()));
|
||||
let result = scene
|
||||
.ucmd()
|
||||
.arg("--time-style=iso")
|
||||
.arg("--full-time")
|
||||
.succeeds();
|
||||
assert!(re_full.is_match(&result.stdout_str()));
|
||||
assert!(re_full.is_match(result.stdout_str()));
|
||||
let result = scene
|
||||
.ucmd()
|
||||
.arg("--full-time")
|
||||
.arg("--time-style=iso")
|
||||
.succeeds();
|
||||
assert!(re_iso.is_match(&result.stdout_str()));
|
||||
assert!(re_iso.is_match(result.stdout_str()));
|
||||
|
||||
let result = scene
|
||||
.ucmd()
|
||||
|
@ -743,7 +743,7 @@ fn test_ls_styles() {
|
|||
.arg("--time-style=iso")
|
||||
.arg("--full-time")
|
||||
.succeeds();
|
||||
assert!(re_full.is_match(&result.stdout_str()));
|
||||
assert!(re_full.is_match(result.stdout_str()));
|
||||
|
||||
let result = scene
|
||||
.ucmd()
|
||||
|
@ -751,7 +751,7 @@ fn test_ls_styles() {
|
|||
.arg("-x")
|
||||
.arg("-l")
|
||||
.succeeds();
|
||||
assert!(re_full.is_match(&result.stdout_str()));
|
||||
assert!(re_full.is_match(result.stdout_str()));
|
||||
|
||||
at.touch("test2");
|
||||
let result = scene.ucmd().arg("--full-time").arg("-x").succeeds();
|
||||
|
|
|
@ -38,7 +38,7 @@ fn test_posix_mode() {
|
|||
|
||||
// fail on long path
|
||||
new_ucmd!()
|
||||
.args(&["-p", &"dir".repeat(libc::PATH_MAX as usize + 1).as_str()])
|
||||
.args(&["-p", "dir".repeat(libc::PATH_MAX as usize + 1).as_str()])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
||||
|
@ -46,7 +46,7 @@ fn test_posix_mode() {
|
|||
new_ucmd!()
|
||||
.args(&[
|
||||
"-p",
|
||||
&format!("dir/{}", "file".repeat(libc::FILENAME_MAX as usize + 1)).as_str(),
|
||||
format!("dir/{}", "file".repeat(libc::FILENAME_MAX as usize + 1)).as_str(),
|
||||
])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
@ -76,7 +76,7 @@ fn test_posix_special() {
|
|||
|
||||
// fail on long path
|
||||
new_ucmd!()
|
||||
.args(&["-P", &"dir".repeat(libc::PATH_MAX as usize + 1).as_str()])
|
||||
.args(&["-P", "dir".repeat(libc::PATH_MAX as usize + 1).as_str()])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
||||
|
@ -84,7 +84,7 @@ fn test_posix_special() {
|
|||
new_ucmd!()
|
||||
.args(&[
|
||||
"-P",
|
||||
&format!("dir/{}", "file".repeat(libc::FILENAME_MAX as usize + 1)).as_str(),
|
||||
format!("dir/{}", "file".repeat(libc::FILENAME_MAX as usize + 1)).as_str(),
|
||||
])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
@ -117,7 +117,7 @@ fn test_posix_all() {
|
|||
.args(&[
|
||||
"-p",
|
||||
"-P",
|
||||
&"dir".repeat(libc::PATH_MAX as usize + 1).as_str(),
|
||||
"dir".repeat(libc::PATH_MAX as usize + 1).as_str(),
|
||||
])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
@ -127,7 +127,7 @@ fn test_posix_all() {
|
|||
.args(&[
|
||||
"-p",
|
||||
"-P",
|
||||
&format!("dir/{}", "file".repeat(libc::FILENAME_MAX as usize + 1)).as_str(),
|
||||
format!("dir/{}", "file".repeat(libc::FILENAME_MAX as usize + 1)).as_str(),
|
||||
])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue