Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,23 @@ private struct DateFormatStyleTests {
let locale = Locale(identifier: "es_ES")
await usingCurrentInternationalizationPreferences {
#expect(date.formatted(date: .long, time: .complete) == date.formatted(Date.FormatStyle(date: .long, time: .complete)))
}
#expect(
date.formatted(
.dateTime
.day()
.month()
.year()
.locale(locale)
) ==
date.formatted(
Date.FormatStyle()
.day()
.month()
.year()
.locale(locale)
#expect(
date.formatted(
.dateTime
.day()
.month()
.year()
.locale(locale)
) ==
date.formatted(
Date.FormatStyle()
.day()
.month()
.year()
.locale(locale)
)
)
)
}
}

@Test func dateFormatStyleIndividualFields() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ private struct DateIntervalFormatStyleTests {
// This test assumes both the left side and the right side of the comparison has the same `Locale.autoupdatingCurrent`, which assumes the state of the host machine remains unchanged.
#expect(range.formatted() == Date.IntervalFormatStyle().format(range))
#expect(range.formatted(date: .numeric, time: .shortened) == Date.IntervalFormatStyle(date: .numeric, time: .shortened).format(range))
#expect(range.formatted(.interval.day().month().year().locale(locale)) == Date.IntervalFormatStyle().day().month().year().locale(locale).format(range))
}

#expect(range.formatted(.interval.day().month().year().locale(locale)) == Date.IntervalFormatStyle().day().month().year().locale(locale).format(range))
}

#if FIXED_ICU_74_DAYPERIOD
Expand Down