Skip to content

Commit b2ab762

Browse files
authored
Fix leadingDotSyntax test reliance on current internationalization preferences (#1528)
* Fix leadingDotSyntax test reliance on current i18n preferences * Fix build failure
1 parent 97b4581 commit b2ab762

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Tests/FoundationInternationalizationTests/Formatting/DateFormatStyleTests.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,23 @@ private struct DateFormatStyleTests {
192192
let locale = Locale(identifier: "es_ES")
193193
await usingCurrentInternationalizationPreferences {
194194
#expect(date.formatted(date: .long, time: .complete) == date.formatted(Date.FormatStyle(date: .long, time: .complete)))
195-
}
196-
#expect(
197-
date.formatted(
198-
.dateTime
199-
.day()
200-
.month()
201-
.year()
202-
.locale(locale)
203-
) ==
204-
date.formatted(
205-
Date.FormatStyle()
206-
.day()
207-
.month()
208-
.year()
209-
.locale(locale)
195+
#expect(
196+
date.formatted(
197+
.dateTime
198+
.day()
199+
.month()
200+
.year()
201+
.locale(locale)
202+
) ==
203+
date.formatted(
204+
Date.FormatStyle()
205+
.day()
206+
.month()
207+
.year()
208+
.locale(locale)
209+
)
210210
)
211-
)
211+
}
212212
}
213213

214214
@Test func dateFormatStyleIndividualFields() {

Tests/FoundationInternationalizationTests/Formatting/DateIntervalFormatStyleTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ private struct DateIntervalFormatStyleTests {
106106
// 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.
107107
#expect(range.formatted() == Date.IntervalFormatStyle().format(range))
108108
#expect(range.formatted(date: .numeric, time: .shortened) == Date.IntervalFormatStyle(date: .numeric, time: .shortened).format(range))
109+
#expect(range.formatted(.interval.day().month().year().locale(locale)) == Date.IntervalFormatStyle().day().month().year().locale(locale).format(range))
109110
}
110111

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

114114
#if FIXED_ICU_74_DAYPERIOD

0 commit comments

Comments
 (0)