mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
du: test behavior with POSIXLY_CORRECT set
This commit is contained in:
parent
356023b055
commit
030fd3d4d2
1 changed files with 26 additions and 0 deletions
|
@ -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]
|
#[test]
|
||||||
fn test_du_basics_bad_name() {
|
fn test_du_basics_bad_name() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue