Skip to content

Commit ed277ba

Browse files
#430: Add incorrectTimezoneTest
1 parent bf689b3 commit ed277ba

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

core/linux/test/TimeZoneNativeTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ class TimeZoneNativeTest {
6868
)
6969
}
7070

71+
@Test
72+
fun incorrectTimezoneTest() {
73+
root = "${RESOURCES}incorrect-timezone/"
74+
75+
val exception = assertFailsWith<IllegalTimeZoneException> {
76+
TimeZone.currentSystemDefault()
77+
}
78+
79+
assertTrue(
80+
exception.message?.startsWith("Could not determine the timezone ID") == true,
81+
"Exception message did not match"
82+
)
83+
}
84+
7185
companion object {
7286
const val RESOURCES = "./linux/test/time-zone-native-test-resources/"
7387
}

core/linux/test/time-zone-native-test-resources/incorrect-timezone/etc/localtime

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
incorrect/timezone

core/linux/test/time-zone-native-test-resources/missing-timezone/etc/localtime

Lines changed: 0 additions & 1 deletion
This file was deleted.

core/linux/test/time-zone-native-test-resources/missing-timezone/etc/localtime

Whitespace-only changes.

0 commit comments

Comments
 (0)