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 11FROM openjdk:11.0.16-jdk as build
22
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
55
66RUN mkdir -p /kotlin-compiler-server
77WORKDIR /kotlin-compiler-server
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ val copyJSDependencies by tasks.creating(Copy::class) {
4646plugins {
4747 id(" org.springframework.boot" ) version " 2.7.7"
4848 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"
5151}
5252
5353allprojects {
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
33systemProp.policy =executor.policy
44systemProp.indexes =indexes.json
55systemProp.indexesJs =indexesJs.json
Original file line number Diff line number Diff line change 11# this file is autogenerated by build.gradle.kts
2- kotlin.version =1.8.0-Beta
2+ kotlin.version =1.8.0
33policy.file =executor.policy
44indexes.file =indexes.json
55indexesJs.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
88spring.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 1515 "version" : " 1.6.21"
1616 },
1717 {
18- "version" : " 1.7.21" ,
19- "latestStable" : true
18+ "version" : " 1.7.21"
2019 },
2120 {
22- "version" : " 1.8.0-RC2"
21+ "version" : " 1.8.0" ,
22+ "latestStable" : true
2323 }
2424]
You can’t perform that action at this time.
0 commit comments