1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

Merge branch 'main' into hotfix-mktemp

This commit is contained in:
Zaú Júlio 2023-03-03 14:22:07 -03:00 committed by GitHub
commit 65b1be9456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 106 additions and 51 deletions

View file

@ -391,7 +391,12 @@ fn test_du_h_flag_empty_file() {
fn test_du_time() {
let ts = TestScenario::new(util_name!());
// du --time formats the timestamp according to the local timezone. We set the TZ
// environment variable to UTC in the commands below to ensure consistent outputs
// and test results regardless of the timezone of the machine this test runs in.
ts.ccmd("touch")
.env("TZ", "UTC")
.arg("-a")
.arg("-t")
.arg("201505150000")
@ -399,19 +404,35 @@ fn test_du_time() {
.succeeds();
ts.ccmd("touch")
.env("TZ", "UTC")
.arg("-m")
.arg("-t")
.arg("201606160000")
.arg("date_test")
.succeeds();
let result = ts.ucmd().arg("--time").arg("date_test").succeeds();
let result = ts
.ucmd()
.env("TZ", "UTC")
.arg("--time")
.arg("date_test")
.succeeds();
result.stdout_only("0\t2016-06-16 00:00\tdate_test\n");
let result = ts.ucmd().arg("--time=atime").arg("date_test").succeeds();
let result = ts
.ucmd()
.env("TZ", "UTC")
.arg("--time=atime")
.arg("date_test")
.succeeds();
result.stdout_only("0\t2015-05-15 00:00\tdate_test\n");
let result = ts.ucmd().arg("--time=ctime").arg("date_test").succeeds();
let result = ts
.ucmd()
.env("TZ", "UTC")
.arg("--time=ctime")
.arg("date_test")
.succeeds();
result.stdout_only("0\t2016-06-16 00:00\tdate_test\n");
if birth_supported() {