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

du: test behavior with POSIXLY_CORRECT set

This commit is contained in:
Daniel Hofstetter 2023-11-14 14:24:12 +01:00 committed by Sylvestre Ledru
parent 356023b055
commit 030fd3d4d2

View file

@ -118,6 +118,32 @@ fn test_du_invalid_size() {
}
}
#[test]
fn test_du_with_posixly_correct() {
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
let dir = "a";
at.mkdir(dir);
at.write(&format!("{dir}/file"), "some content");
let expected = ts
.ucmd()
.arg(dir)
.arg("--block-size=512")
.succeeds()
.stdout_move_str();
let result = ts
.ucmd()
.arg(dir)
.env("POSIXLY_CORRECT", "1")
.succeeds()
.stdout_move_str();
assert_eq!(expected, result);
}
#[test]
fn test_du_basics_bad_name() {
new_ucmd!()