mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
fix clippy tests
This commit is contained in:
parent
81de2be5ab
commit
ab67947321
31 changed files with 1259 additions and 888 deletions
|
@ -16,11 +16,12 @@ fn test_invalid_arg() {
|
|||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[allow(unused_mut)]
|
||||
fn test_id_no_specified_user() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let result = ts.ucmd().run();
|
||||
let exp_result = unwrap_or_return!(expected_result(&ts, &[]));
|
||||
let mut _exp_stdout = exp_result.stdout_str().to_string();
|
||||
let mut exp_stdout = exp_result.stdout_str().to_string();
|
||||
|
||||
#[cfg(not(feature = "feat_selinux"))]
|
||||
{
|
||||
|
@ -29,12 +30,12 @@ fn test_id_no_specified_user() {
|
|||
// uid=1001(runner) gid=121(docker) groups=121(docker),4(adm),101(systemd-journal) \
|
||||
// context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
|
||||
if let Some(context_offset) = exp_result.stdout_str().find(" context=") {
|
||||
_exp_stdout.replace_range(context_offset.._exp_stdout.len() - 1, "");
|
||||
exp_stdout.replace_range(context_offset..exp_stdout.len() - 1, "");
|
||||
}
|
||||
}
|
||||
|
||||
result
|
||||
.stdout_is(_exp_stdout)
|
||||
.stdout_is(exp_stdout)
|
||||
.stderr_is(exp_result.stderr_str())
|
||||
.code_is(exp_result.code());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue