Skip to content

Commit f75a4ea

Browse files
committed
Improve the output of the test that checks timezone availability
1 parent d2aaec1 commit f75a4ea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/common/test/TimeZoneTest.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,24 @@ class TimeZoneTest {
4646

4747
@Test
4848
fun availableZonesAreAvailable() {
49+
val availableZones = mutableListOf<String>()
50+
val nonAvailableZones = mutableListOf<Exception>()
4951
for (zoneName in TimeZone.availableZoneIds) {
5052
val timezone = try {
5153
TimeZone.of(zoneName)
5254
} catch (e: Exception) {
53-
throw Exception("Zone $zoneName is not available", e)
55+
nonAvailableZones.add(e)
56+
continue
5457
}
58+
availableZones.add(zoneName)
5559
Instant.DISTANT_FUTURE.toLocalDateTime(timezone).toInstant(timezone)
5660
Instant.DISTANT_PAST.toLocalDateTime(timezone).toInstant(timezone)
5761
}
62+
if (nonAvailableZones.isNotEmpty()) {
63+
println("Available zones: $availableZones")
64+
println("Non-available zones: $nonAvailableZones")
65+
throw nonAvailableZones[0]
66+
}
5867
}
5968

6069
@Test

0 commit comments

Comments
 (0)