File tree 3 files changed +19
-1
lines changed 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ FROM --platform=linux/arm64 ubuntu:24.04
2
2
3
3
RUN apt-get update && apt-get install -y tzdata
4
4
5
+ ENV INSIDE_TESTCONTAINERS=true
6
+
5
7
# 4: Arctic/Longyearbyen
6
8
RUN echo 4 | dpkg-reconfigure tzdata
7
9
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ FROM --platform=linux/arm64 ubuntu:24.04
2
2
3
3
RUN apt-get update && apt-get install -y tzdata
4
4
5
+ ENV INSIDE_TESTCONTAINERS=true
6
+
5
7
# 4: Arctic/Longyearbyen
6
8
RUN echo 4 | dpkg-reconfigure tzdata
7
9
Original file line number Diff line number Diff line change 5
5
6
6
package kotlinx.datetime.test
7
7
8
+ import kotlinx.cinterop.ExperimentalForeignApi
9
+ import kotlinx.cinterop.toKString
8
10
import kotlinx.datetime.*
9
11
import kotlin.test.*
12
+ import platform.posix.getenv
10
13
11
14
class TimeZoneLinuxNativeTest {
15
+
16
+ private var shouldRunTests = false
17
+
18
+ @OptIn(ExperimentalForeignApi ::class )
19
+ @BeforeTest
20
+ fun setup () {
21
+ shouldRunTests = getenv(" INSIDE_TESTCONTAINERS" )?.toKString() != null
22
+ }
23
+
12
24
@Test
13
25
fun defaultTimeZoneTest () {
26
+ if (! shouldRunTests) return
27
+
14
28
val tz = TimeZone .currentSystemDefault()
15
- println (" LINUX TIMEZONE: $tz " )
29
+ println (" TIMEZONE: $tz " )
16
30
assertEquals(TimeZone .of(" Europe/Oslo" ), tz)
17
31
}
18
32
}
You can’t perform that action at this time.
0 commit comments