Skip to content

Commit 497a37c

Browse files
committed
tests/date: add %+10D composite parity test
1 parent 0e51ec8 commit 497a37c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

tests/by-util/test_date.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,6 @@ fn test_date_strftime_composite_modifiers_are_atomic() {
19821982
("+%10R", " 03:04\n"),
19831983
("+%10x", " 06/15/24\n"),
19841984
("+%10X", " 03:04:05\n"),
1985-
("+%+10D", "0006/15/24\n"),
19861985
];
19871986

19881987
for (format, expected) in test_cases {
@@ -1997,6 +1996,20 @@ fn test_date_strftime_composite_modifiers_are_atomic() {
19971996
}
19981997
}
19991998

1999+
#[test]
2000+
fn test_date_strftime_plus_width_on_composite() {
2001+
// GNU applies %+10D to the full composite output with zero padding,
2002+
// and does not inject a leading sign into the composite string.
2003+
new_ucmd!()
2004+
.env("LC_ALL", "C")
2005+
.env("TZ", "UTC")
2006+
.arg("-d")
2007+
.arg("2024-06-15 03:04:05")
2008+
.arg("+%+10D")
2009+
.succeeds()
2010+
.stdout_is("0006/15/24\n");
2011+
}
2012+
20002013
#[test]
20012014
#[ignore = "https://github.com/uutils/coreutils/issues/11656 — GNU date strips the `O` strftime modifier in C locale (e.g. `%Om` -> `%m`); uutils leaks it as literal `%om`."]
20022015
fn test_date_strftime_o_modifier() {

0 commit comments

Comments
 (0)