mirror of
https://github.com/uutils/coreutils
synced 2024-07-23 19:04:18 +00:00
clippy: fix redundant_clone lint warnings in tests
This commit is contained in:
parent
2ee782fcf1
commit
29e5d0b42b
|
@ -471,7 +471,7 @@ fn test_chown_fail_id() {
|
|||
#[test]
|
||||
fn test_chown_only_user_id_nonexistent_user() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = &ts.fixtures;
|
||||
at.touch("f");
|
||||
if let Ok(result) = run_ucmd_as_root(&ts, &["12345", "f"]) {
|
||||
result.success().no_stdout().no_stderr();
|
||||
|
@ -537,7 +537,7 @@ fn test_chown_only_group_id() {
|
|||
#[test]
|
||||
fn test_chown_only_group_id_nonexistent_group() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = &ts.fixtures;
|
||||
at.touch("f");
|
||||
if let Ok(result) = run_ucmd_as_root(&ts, &[":12345", "f"]) {
|
||||
result.success().no_stdout().no_stderr();
|
||||
|
|
|
@ -165,7 +165,7 @@ fn test_chroot_skip_chdir_not_root() {
|
|||
#[test]
|
||||
fn test_chroot_skip_chdir() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = &ts.fixtures;
|
||||
let dirs = ["/", "/.", "/..", "isroot"];
|
||||
at.symlink_file("/", "isroot");
|
||||
for dir in dirs {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#[cfg(target_os = "linux")]
|
||||
use crate::common::util::expected_result;
|
||||
use crate::common::util::TestScenario;
|
||||
use ::env::native_int_str::{Convert, NCvt};
|
||||
use env::native_int_str::{Convert, NCvt};
|
||||
use regex::Regex;
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
|
@ -475,8 +475,8 @@ fn test_gnu_e20() {
|
|||
|
||||
#[test]
|
||||
fn test_split_string_misc() {
|
||||
use ::env::native_int_str::NCvt;
|
||||
use ::env::parse_args_from_str;
|
||||
use env::native_int_str::NCvt;
|
||||
use env::parse_args_from_str;
|
||||
|
||||
assert_eq!(
|
||||
NCvt::convert(vec!["A=B", "FOO=AR", "sh", "-c", "echo $A$FOO"]),
|
||||
|
@ -692,13 +692,13 @@ fn test_env_overwrite_arg0() {
|
|||
fn test_env_arg_argv0_overwrite() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
|
||||
let bin = ts.bin_path.clone();
|
||||
let bin = &ts.bin_path;
|
||||
|
||||
// overwrite --argv0 by --argv0
|
||||
ts.ucmd()
|
||||
.args(&["--argv0", "dirname"])
|
||||
.args(&["--argv0", "echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -708,7 +708,7 @@ fn test_env_arg_argv0_overwrite() {
|
|||
ts.ucmd()
|
||||
.args(&["-a", "dirname"])
|
||||
.args(&["-a", "echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -718,7 +718,7 @@ fn test_env_arg_argv0_overwrite() {
|
|||
ts.ucmd()
|
||||
.args(&["--argv0", "dirname"])
|
||||
.args(&["-a", "echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -728,7 +728,7 @@ fn test_env_arg_argv0_overwrite() {
|
|||
ts.ucmd()
|
||||
.args(&["-a", "dirname"])
|
||||
.args(&["--argv0", "echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -740,13 +740,13 @@ fn test_env_arg_argv0_overwrite() {
|
|||
fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
|
||||
let bin = ts.bin_path.clone();
|
||||
let bin = &ts.bin_path;
|
||||
|
||||
// string arg following normal
|
||||
ts.ucmd()
|
||||
.args(&["-S--argv0 dirname"])
|
||||
.args(&["--argv0", "echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -756,7 +756,7 @@ fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
|
|||
ts.ucmd()
|
||||
.args(&["-a", "dirname"])
|
||||
.args(&["-S-a echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -765,7 +765,7 @@ fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
|
|||
// one large string arg
|
||||
ts.ucmd()
|
||||
.args(&["-S--argv0 dirname -a echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -775,7 +775,7 @@ fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
|
|||
ts.ucmd()
|
||||
.args(&["-S-a dirname"])
|
||||
.args(&["-S--argv0 echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -786,7 +786,7 @@ fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
|
|||
.args(&["-a", "sleep"])
|
||||
.args(&["-S-a dirname"])
|
||||
.args(&["-a", "echo"])
|
||||
.arg(&bin)
|
||||
.arg(bin)
|
||||
.args(&["aa/bb/cc"])
|
||||
.succeeds()
|
||||
.stdout_is("aa/bb/cc\n")
|
||||
|
@ -916,8 +916,8 @@ mod tests_split_iterator {
|
|||
|
||||
use std::ffi::OsString;
|
||||
|
||||
use ::env::parse_error::ParseError;
|
||||
use env::native_int_str::{from_native_int_representation_owned, Convert, NCvt};
|
||||
use env::parse_error::ParseError;
|
||||
|
||||
fn split(input: &str) -> Result<Vec<OsString>, ParseError> {
|
||||
::env::split_iterator::split(&NCvt::convert(input)).map(|vec| {
|
||||
|
|
|
@ -1689,7 +1689,7 @@ fn test_target_file_ends_with_slash() {
|
|||
#[test]
|
||||
fn test_install_root_combined() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = &ts.fixtures;
|
||||
at.touch("a");
|
||||
at.touch("c");
|
||||
|
||||
|
|
Loading…
Reference in a new issue