mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #5530 from cakebaker/du_test_posixly_correct
du: test behavior with POSIXLY_CORRECT set
This commit is contained in:
@@ -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!()
|
||||
|
||||
Reference in New Issue
Block a user