Skip to content

Commit 0af8e02

Browse files
committed
tests/date: add test date strftime O and E modifier
1 parent d2b926d commit 0af8e02

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/by-util/test_date.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,6 @@ fn test_date_strftime_flag_on_composite() {
19651965
}
19661966

19671967
#[test]
1968-
#[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`."]
19691968
fn test_date_strftime_o_modifier() {
19701969
// In C locale the `O` modifier is a no-op (alternative numeric symbols).
19711970
// GNU renders `%Om` as `06` for June; uutils renders it as the literal `%Om`.
@@ -1979,6 +1978,20 @@ fn test_date_strftime_o_modifier() {
19791978
.stdout_is("06-24-12\n");
19801979
}
19811980

1981+
#[test]
1982+
fn test_date_strftime_e_modifier() {
1983+
// In C locale the `E` modifier is a no-op (alternative era).
1984+
// GNU does not render `%Em`; uutils renders it as the literal `%Em` as `06` for June.
1985+
new_ucmd!()
1986+
.env("LC_ALL", "C")
1987+
.env("TZ", "UTC")
1988+
.arg("-d")
1989+
.arg("2024-06-15")
1990+
.arg("+%Em-%Ey-%El")
1991+
.succeeds()
1992+
.stdout_is("06-24-12\n");
1993+
}
1994+
19821995
#[test]
19831996
#[ignore = "https://github.com/uutils/parse_datetime/issues/280 — GNU date accepts bare timezone abbreviations (UT, GMT, ...) meaning `now in that TZ`; parse_datetime rejects them."]
19841997
fn test_date_bare_timezone_abbreviation() {

0 commit comments

Comments
 (0)