1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

test_du: fix unnecessary boolean operation

This commit is contained in:
Koki Ueha 2023-03-19 04:59:08 +00:00
parent 60bf8e1f88
commit 0b042f0b32

View file

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