Merge pull request #4548 from papparapa/test-du-clippy-if-not-else

test_du: fix unnecessary boolean operation
This commit is contained in:
Sylvestre Ledru 2023-03-19 08:56:57 +01:00 committed by GitHub
commit 10b4aeb2c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,10 +82,10 @@ fn _du_basics_subdir(s: &str) {
))]
fn _du_basics_subdir(s: &str) {
// MS-WSL linux has altered expected output
if !uucore::os::is_wsl_1() {
assert_eq!(s, "8\tsubdir/deeper\n");
} else {
if uucore::os::is_wsl_1() {
assert_eq!(s, "0\tsubdir/deeper\n");
} else {
assert_eq!(s, "8\tsubdir/deeper\n");
}
}
@ -164,10 +164,10 @@ fn _du_soft_link(s: &str) {
))]
fn _du_soft_link(s: &str) {
// MS-WSL linux has altered expected output
if !uucore::os::is_wsl_1() {
assert_eq!(s, "16\tsubdir/links\n");
} else {
if uucore::os::is_wsl_1() {
assert_eq!(s, "8\tsubdir/links\n");
} else {
assert_eq!(s, "16\tsubdir/links\n");
}
}
@ -212,10 +212,10 @@ fn _du_hard_link(s: &str) {
))]
fn _du_hard_link(s: &str) {
// MS-WSL linux has altered expected output
if !uucore::os::is_wsl_1() {
assert_eq!(s, "16\tsubdir/links\n");
} else {
if uucore::os::is_wsl_1() {
assert_eq!(s, "8\tsubdir/links\n");
} else {
assert_eq!(s, "16\tsubdir/links\n");
}
}
@ -255,10 +255,10 @@ fn _du_d_flag(s: &str) {
))]
fn _du_d_flag(s: &str) {
// MS-WSL linux has altered expected output
if !uucore::os::is_wsl_1() {
assert_eq!(s, "28\t./subdir\n36\t.\n");
} else {
if uucore::os::is_wsl_1() {
assert_eq!(s, "8\t./subdir\n8\t.\n");
} else {
assert_eq!(s, "28\t./subdir\n36\t.\n");
}
}
@ -303,10 +303,10 @@ fn _du_dereference(s: &str) {
))]
fn _du_dereference(s: &str) {
// MS-WSL linux has altered expected output
if !uucore::os::is_wsl_1() {
assert_eq!(s, "8\tsubdir/links/deeper_dir\n24\tsubdir/links\n");
} else {
if uucore::os::is_wsl_1() {
assert_eq!(s, "0\tsubdir/links/deeper_dir\n8\tsubdir/links\n");
} else {
assert_eq!(s, "8\tsubdir/links/deeper_dir\n24\tsubdir/links\n");
}
}