Add tests for kotlin language support in the expressions dsl

This commit is contained in:
Vitaliy.Bibaev
2017-10-14 11:29:00 +03:00
committed by Yan Zhulanow
parent 8185354116
commit 64f399235e
50 changed files with 155 additions and 0 deletions
@@ -0,0 +1 @@
val array: kotlin.DoubleArray = kotlin.doubleArrayOf(10.0, 20.0)
@@ -0,0 +1 @@
val a: kotlin.IntArray
@@ -0,0 +1 @@
val array: kotlin.IntArray = kotlin.IntArray(10)
@@ -0,0 +1,2 @@
a[0] = 1
a[1] = 2
@@ -0,0 +1,2 @@
a[10]!!
a[11]!!
+2
View File
@@ -0,0 +1,2 @@
var a: kotlin.Int
a = 100
+1
View File
@@ -0,0 +1 @@
this.method()
+1
View File
@@ -0,0 +1 @@
this.method(10, 20, 30)
+1
View File
@@ -0,0 +1 @@
this.method(10)
@@ -0,0 +1,2 @@
var a: kotlin.Int = 10
a
@@ -0,0 +1 @@
var a: kotlin.Int
@@ -0,0 +1 @@
var a: kotlin.Int
@@ -0,0 +1 @@
val a: kotlin.Int = 10
+4
View File
@@ -0,0 +1,4 @@
val objects: kotlin.collections.MutableList<kotlin.Any> = getObjects()
for (object in objects) {
object.toString()
}
+6
View File
@@ -0,0 +1,6 @@
val objects: kotlin.collections.MutableList<kotlin.Any> = getObjects()
var i: kotlin.Int = 0
while (i < objects.size()) {
i.toString()
i++
}
+3
View File
@@ -0,0 +1,3 @@
if (true) {
receiver.success()
}
+5
View File
@@ -0,0 +1,5 @@
if (false) {
this.success()
} else {
this.fail()
}
+7
View File
@@ -0,0 +1,7 @@
if (false) {
this.success()
} else {
if (true) {
this.failSuccess()
}
}
+9
View File
@@ -0,0 +1,9 @@
if (false) {
this.success()
} else {
if (true) {
this.failSuccess()
} else {
this.failFail()
}
}
@@ -0,0 +1,4 @@
{ y ->
y.method1()
y
}
@@ -0,0 +1,3 @@
{ y ->
y
}
@@ -0,0 +1,4 @@
{ y ->
y.method1()
y.method2()
}
@@ -0,0 +1,3 @@
{ x ->
x.method()
}
@@ -0,0 +1 @@
var map: kotlin.collections.MutableMap<kotlin.Int, kotlin.Boolean>
@@ -0,0 +1 @@
val map: kotlin.collections.MutableMap<kotlin.Int, kotlin.Boolean> = kotlin.collections.linkedMapOf()
@@ -0,0 +1 @@
var lst: kotlin.collections.MutableList<kotlin.Int>
@@ -0,0 +1,5 @@
val lst: kotlin.collections.MutableList<kotlin.Long> = kotlin.collections.mutableListOf()
lst.add(100)
lst.get(0).methodWithSideEffect()
lst.set(1, lst.get(0))
lst.contains(lst.size)
+4
View File
@@ -0,0 +1,4 @@
val objects: kotlin.collections.MutableList<kotlin.Any> = getObjects()
for (object in objects) {
break
}
@@ -0,0 +1,6 @@
val objects: kotlin.collections.MutableList<kotlin.Any> = getObjects()
for (object in objects) {
if (object.isEmpty) {
break
}
}
@@ -0,0 +1,3 @@
map.getOrPut(key, { y ->
map.method()
}
+1
View File
@@ -0,0 +1 @@
key in map
@@ -0,0 +1,13 @@
var resultArray: kotlin.Array<kotlin.Any?> = arrayOfNulls<kotlin.Any>(0)
run {
val size: kotlin.Int = map.size
val keys: kotlin.IntArray = kotlin.IntArray(size)
val values: kotlin.Array<kotlin.Any?> = kotlin.arrayOfNulls(size)
var i: kotlin.Int = 0
for (key in map.keys) {
keys[i] = key
values[i] = map[key]
i++
}
resultArray = kotlin.arrayOf<kotlin.Any?>(keys, values)
}
@@ -0,0 +1 @@
val map: kotlin.collections.MutableMap<kotlin.Int, kotlin.Boolean>
+1
View File
@@ -0,0 +1 @@
map[key]
@@ -0,0 +1 @@
val map: kotlin.collections.MutableMap<kotlin.Int, kotlin.Int> = kotlin.collections.mutableMapOf()
+1
View File
@@ -0,0 +1 @@
map[key] = value
@@ -0,0 +1,2 @@
val a: kotlin.Int = 10
val b: kotlin.Int = 20
@@ -0,0 +1,2 @@
val a: kotlin.Int = 10
val b: kotlin.Int = 20
+1
View File
@@ -0,0 +1 @@
!lst.contains(1)
@@ -0,0 +1,6 @@
var a: kotlin.Int
if (true) {
a = 100
} else {
a = 200
}
+6
View File
@@ -0,0 +1,6 @@
run {
this.method()
run {
this.method()
}
}
+1
View File
@@ -0,0 +1 @@
lst = kotlin.collections.mutableListOf<kotlin.Int>(0, 1, 2, 3)
+6
View File
@@ -0,0 +1,6 @@
val usualType: kotlin.Any
val nullableType: kotlin.Any?
val arrayWithNullableElements: kotlin.Array<kotlin.Any?>
val nullableArrayWithNullableElements: kotlin.Array<kotlin.Any?>?
val nullableList: kotlin.collections.MutableList<kotlin.Boolean>?
val mapWithNullableValues: kotlin.collections.MutableMap<kotlin.Int, kotlin.Any?>
+1
View File
@@ -0,0 +1 @@
a.myProperty
+3
View File
@@ -0,0 +1,3 @@
run {
this.method()
}
@@ -0,0 +1 @@
arrayOfNulls<kotlin.String>(100)
@@ -0,0 +1 @@
val time: java.util.concurrent.atomic.AtomicInteger = java.util.concurrent.atomic.AtomicInteger()
+5
View File
@@ -0,0 +1,5 @@
try {
this.hashCode()
} catch(e : kotlin.Throwable) {
this.fail()
}
+2
View File
@@ -0,0 +1,2 @@
var a: kotlin.Int = 100
val b: kotlin.Int = a