Skip to content

Commit 17d03a7

Browse files
committed
AMEND
1 parent d815e46 commit 17d03a7

File tree

10 files changed

+3
-25
lines changed

10 files changed

+3
-25
lines changed

core/common/src/TimeZone.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public expect open class TimeZone {
3232
*
3333
* If the current system time zone changes, this function can reflect this change on the next invocation.
3434
*
35-
* @throws IllegalTimeZoneException on the Wasm WASI platform due to the lack of support for retrieving system time zone information.
35+
* Always return `UTC` timezone on the Wasm WASI platform due to the lack of support for retrieving system time zone information.
3636
*/
3737
public fun currentSystemDefault(): TimeZone
3838

core/common/test/InstantTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class InstantTest {
5252
}
5353

5454
@Test
55-
@WasmWasiIgnore
5655
fun instantToLocalDTConversion() {
5756
val now = Clock.System.now()
5857
println(now.toLocalDateTime(TimeZone.UTC))

core/common/test/LocalDateTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class LocalDateTest {
117117
}
118118

119119
@Test
120-
@WasmWasiIgnore
121120
@Suppress("UNUSED_VARIABLE")
122121
fun tomorrow() {
123122
val today = Clock.System.todayIn(TimeZone.currentSystemDefault())

core/common/test/LocalDateTimeTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ class LocalDateTimeTest {
6666
}
6767

6868
@Test
69-
@WasmWasiIgnore
7069
fun getCurrentHMS() {
7170
with(Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault())) {
7271
println("${hour}h ${minute}m")

core/common/test/ReadmeTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class ReadmeTest {
2121
}
2222

2323
@Test
24-
@WasmWasiIgnore
2524
fun testConvertingAnInstantToLocalDateAndTimeComponents() {
2625
val currentMoment: Instant = Clock.System.now()
2726
val datetimeInUtc: LocalDateTime = currentMoment.toLocalDateTime(TimeZone.UTC)
@@ -36,7 +35,6 @@ class ReadmeTest {
3635
}
3736

3837
@Test
39-
@WasmWasiIgnore
4038
fun testGettingLocalDateComponents() {
4139
val now: Instant = Clock.System.now()
4240
val today: LocalDate = now.toLocalDateTime(TimeZone.currentSystemDefault()).date
@@ -47,7 +45,6 @@ class ReadmeTest {
4745
}
4846

4947
@Test
50-
@WasmWasiIgnore
5148
fun testGettingLocalTimeComponents() {
5249
val now: Instant = Clock.System.now()
5350
val thisTime: LocalTime = now.toLocalDateTime(TimeZone.currentSystemDefault()).time
@@ -147,7 +144,6 @@ class ReadmeTest {
147144
}
148145

149146
@Test
150-
@WasmWasiIgnore
151147
fun testInstantArithmetic() {
152148
run {
153149
val now = Clock.System.now()

core/common/test/TimeZoneTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class TimeZoneTest {
2323
}
2424

2525
@Test
26-
@WasmWasiIgnore
2726
fun system() {
2827
val tz = TimeZone.currentSystemDefault()
2928
println(tz)
@@ -34,7 +33,6 @@ class TimeZoneTest {
3433
}
3534

3635
@Test
37-
@WasmWasiIgnore
3836
fun available() {
3937
val allTzIds = TimeZone.availableZoneIds
4038
assertContains(allTzIds, "Europe/Berlin", "Europe/Berlin not in $allTzIds")

core/common/test/format/DateTimeComponentsTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import kotlin.test.*
1212

1313
class DateTimeComponentsTest {
1414
@Test
15-
@WasmWasiIgnore
1615
fun testAssigningIllegalValues() {
1716
val dateTimeComponents = DateTimeComponents().apply { setDateTimeOffset(instant, timeZone.offsetAt(instant)) }
1817
for (field in twoDigitFields) {
@@ -32,7 +31,6 @@ class DateTimeComponentsTest {
3231
}
3332

3433
@Test
35-
@WasmWasiIgnore
3634
fun testAssigningLegalValues() {
3735
val dateTimeComponents = DateTimeComponents().apply { setDateTimeOffset(instant, timeZone.offsetAt(instant)) }
3836
for (field in twoDigitFields) {
@@ -44,7 +42,6 @@ class DateTimeComponentsTest {
4442
}
4543

4644
@Test
47-
@WasmWasiIgnore
4845
fun testGettingInvalidMonth() {
4946
for (month in 1..12) {
5047
assertEquals(Month(month), DateTimeComponents().apply { monthNumber = month }.month)

core/wasmWasi/src/internal/Platform.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ internal actual fun currentTime(): Instant = clockTimeGet().let { time ->
4040
}
4141

4242
internal actual fun currentSystemDefaultZone(): Pair<String, TimeZoneRules?> =
43-
throw UnsupportedOperationException("WASI platform does not support system timezone obtaining")
43+
"UTC" to null
4444

4545
internal actual val systemTzdb: TimeZoneDatabase = TzdbOnData()

core/wasmWasi/src/internal/TimeZonesInitializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ internal class TzdbOnData: TimeZoneDatabase {
4040
}
4141

4242
override fun availableTimeZoneIds(): Set<String> =
43-
timeZonesProvider?.getTimeZones() ?: emptySet()
43+
timeZonesProvider?.getTimeZones() ?: setOf("UTC")
4444
}

core/wasmWasi/test/Utils.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)