File tree Expand file tree Collapse file tree 6 files changed +80
-12
lines changed
test/kotlin/com/compiler/server Expand file tree Collapse file tree 6 files changed +80
-12
lines changed Original file line number Diff line number Diff line change 1
1
FROM openjdk:11.0.16-jdk as build
2
2
3
- ENV KOTLIN_LIB=1.8.0-Beta
4
- ENV KOTLIN_LIB_JS=1.8.0-Beta- js
3
+ ENV KOTLIN_LIB=1.8.0
4
+ ENV KOTLIN_LIB_JS=1.8.0-js
5
5
6
6
RUN mkdir -p /kotlin-compiler-server
7
7
WORKDIR /kotlin-compiler-server
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ val copyJSDependencies by tasks.creating(Copy::class) {
46
46
plugins {
47
47
id(" org.springframework.boot" ) version " 2.7.7"
48
48
id(" io.spring.dependency-management" ) version " 1.1.0"
49
- kotlin(" jvm" ) version " 1.8.0-Beta "
50
- kotlin(" plugin.spring" ) version " 1.8.0-Beta "
49
+ kotlin(" jvm" ) version " 1.8.0"
50
+ kotlin(" plugin.spring" ) version " 1.8.0"
51
51
}
52
52
53
53
allprojects {
Original file line number Diff line number Diff line change 1
- systemProp.kotlinVersion =1.8.0-Beta
2
- systemProp.kotlinIdeVersion =1.8.0-Beta-223
1
+ systemProp.kotlinVersion =1.8.0
2
+ systemProp.kotlinIdeVersion =1.8.0-release-345
3
3
systemProp.policy =executor.policy
4
4
systemProp.indexes =indexes.json
5
5
systemProp.indexesJs =indexesJs.json
Original file line number Diff line number Diff line change 1
1
# this file is autogenerated by build.gradle.kts
2
- kotlin.version =1.8.0-Beta
2
+ kotlin.version =1.8.0
3
3
policy.file =executor.policy
4
4
indexes.file =indexes.json
5
5
indexesJs.file =indexesJs.json
6
- libraries.folder.jvm =1.8.0-Beta
7
- libraries.folder.js =1.8.0-Beta- js
6
+ libraries.folder.jvm =1.8.0
7
+ libraries.folder.js =1.8.0-js
8
8
spring.mvc.pathmatch.matching-strategy =ant_path_matcher
Original file line number Diff line number Diff line change
1
+ package com.compiler.server
2
+
3
+ import com.compiler.server.base.BaseExecutorTest
4
+ import org.junit.jupiter.api.Test
5
+
6
+ class KotlinFeatureSince180 : BaseExecutorTest () {
7
+
8
+ @Test
9
+ fun `stable cbrt() function` () {
10
+ run (
11
+ code = """
12
+ import kotlin.math.*
13
+
14
+ fun main() {
15
+ val num = 27
16
+ val negNum = -num
17
+
18
+ println("The cube root of ${" $" } {num.toDouble()} is: " + cbrt(num.toDouble()))
19
+ }
20
+ """ .trimIndent(),
21
+ contains = " The cube root of 27.0 is: 3.0"
22
+ )
23
+ }
24
+
25
+ @Test
26
+ fun `stable cbrt() function for negative values` () {
27
+ run (
28
+ code = """
29
+ import kotlin.math.*
30
+
31
+ fun main() {
32
+ val num = 27
33
+ val negNum = -num
34
+
35
+ println("The cube root of ${" $" } {negNum.toDouble()} is: " + cbrt(negNum.toDouble()))
36
+ }
37
+ """ .trimIndent(),
38
+ contains = " The cube root of -27.0 is: -3.0"
39
+ )
40
+ }
41
+
42
+ @Test
43
+ fun `calculate the time difference between multiple TimeMarks` () {
44
+ run (
45
+ code = """
46
+ import kotlin.time.*
47
+
48
+ @OptIn(ExperimentalTime::class)
49
+ fun main() {
50
+ val timeSource = TimeSource.Monotonic
51
+ val mark1 = timeSource.markNow()
52
+ Thread.sleep(500) // Sleep 0.5 seconds.
53
+ val mark2 = timeSource.markNow()
54
+
55
+ repeat(4) { n ->
56
+ val mark3 = timeSource.markNow()
57
+ val elapsed1 = mark3 - mark1
58
+ val elapsed2 = mark3 - mark2
59
+
60
+ println(mark2 > mark1)
61
+ }
62
+ }
63
+ """ .trimIndent(),
64
+ contains = " true"
65
+ )
66
+ }
67
+ }
68
+
Original file line number Diff line number Diff line change 15
15
"version" : " 1.6.21"
16
16
},
17
17
{
18
- "version" : " 1.7.21" ,
19
- "latestStable" : true
18
+ "version" : " 1.7.21"
20
19
},
21
20
{
22
- "version" : " 1.8.0-RC2"
21
+ "version" : " 1.8.0" ,
22
+ "latestStable" : true
23
23
}
24
24
]
You can’t perform that action at this time.
0 commit comments