Add 'not linked' kind of spec tests

This commit is contained in:
victor.petukhov
2018-08-28 19:06:59 +03:00
parent 841bb4f253
commit ecf8b88c4c
72 changed files with 1140 additions and 928 deletions
@@ -0,0 +1,29 @@
fun getInt(arg: Any = Any()) = arg.hashCode()
fun getShort(arg: Any = Any()) = arg.hashCode().toShort()
fun getLong(arg: Any = Any()) = arg.hashCode().toLong()
fun getFloat(arg: Any = Any()) = arg.hashCode().toFloat()
fun getDouble(arg: Any = Any()) = arg.hashCode().toDouble()
fun getByte(arg: Any = Any()) = arg.hashCode().toByte()
fun getChar(arg: Any = Any()) = arg.hashCode().toChar()
fun getString(arg: Any = Any()) = arg.hashCode().toString()
fun getBoolean(arg: Any = Any()) = arg.hashCode() % 2 == 0
fun getNothing(): Nothing = throw Exception()
fun getUnit() = {}
fun getAny() = Any()
fun getList() = mutableListOf<Int>()
class _BasicTypesProvider {
fun getInt(arg: Any = Any()) = arg.hashCode()
fun getShort(arg: Any = Any()) = arg.hashCode().toShort()
fun getLong(arg: Any = Any()) = arg.hashCode().toLong()
fun getFloat(arg: Any = Any()) = arg.hashCode().toFloat()
fun getDouble(arg: Any = Any()) = arg.hashCode().toDouble()
fun getByte(arg: Any = Any()) = arg.hashCode().toByte()
fun getChar(arg: Any = Any()) = arg.hashCode().toChar()
fun getString(arg: Any = Any()) = arg.hashCode().toString()
fun getBoolean(arg: Any = Any()) = arg.hashCode() % 2 == 0
fun getNothing(): Nothing = throw Exception()
fun getUnit() = {}
fun getAny() = Any()
fun getList() = mutableListOf<Int>()
}
@@ -0,0 +1,35 @@
class _Class {
val prop_1 = 1
val prop_2 = 2
val prop_3 = 3
fun fun_1(): (Int) -> (Int) -> Int = {number: Int -> { number * 5 }}
fun fun_2(value_1: Int): Int = value_1 * 2
fun fun_3(value_1: Int): (Int) -> Int = fun(value_2: Int): Int = value_1 * value_2 * 2
operator fun contains(a: Int): Boolean = a > 30
operator fun contains(a: Long): Boolean = a > 30L
operator fun contains(a: Char): Boolean = a > 30.toChar()
fun getIntArray(value_1: Int): IntArray = intArrayOf(1, 2, 3, value_1, 91923, 14, 123124)
fun getLongArray(value_1: Long): LongArray = longArrayOf(1L, 2L, 3L, value_1, 9192323244L, 14L, 123124L)
fun getCharArray(value_1: Char): CharArray = charArrayOf(1.toChar(), 2.toChar(), 3.toChar(), value_1)
class _NestedClass {
val prop_4 = 4
val prop_5 = 5
}
}
class _EmptyClass {}
class _ClassWithCompanionObject {
companion object {}
}
open class _ClassLevel1 {}
open class _ClassLevel2: _ClassLevel1() {}
open class _ClassLevel3: _ClassLevel2() {}
open class _ClassLevel4: _ClassLevel3() {}
open class _ClassLevel5: _ClassLevel4() {}
class _ClassLevel6: _ClassLevel5() {}
@@ -0,0 +1,9 @@
enum class _EnumClass {
NORTH, SOUTH, WEST, EAST
}
enum class _EnumClassSingle {
EVERYTHING
}
enum class _EnumClassEmpty
@@ -0,0 +1,7 @@
fun _funWithoutArgs(): Int {
return Any().hashCode().toInt()
}
fun _funWithAnyArg(value_1: Any): Int {
return value_1.hashCode()
}
@@ -0,0 +1 @@
object _EmptyObject {}
@@ -0,0 +1,36 @@
sealed class _SealedClass
data class _SealedChild1(val number: Int) : _SealedClass()
data class _SealedChild2(val e1: Int, val e2: Int) : _SealedClass()
data class _SealedChild3(val m1: Int, val m2: Int) : _SealedClass()
sealed class _SealedClassWithObjects
object _SealedWithObjectsChild1 : _SealedClassWithObjects()
object _SealedWithObjectsChild2 : _SealedClassWithObjects()
object _SealedWithObjectsChild3 : _SealedClassWithObjects()
sealed class _SealedClassSingle
data class _SealedSingleChild1(val number: Int) : _SealedClassSingle()
sealed class _SealedClassSingleWithObject
object _SealedSingleWithObjectChild1: Expr3() {}
sealed class _SealedClassEmpty
sealed class _SealedClassWithMethods
class _SealedWithMethodsChild1() : _SealedClassWithMethods() {
fun m1() = this.hashCode().toString()
}
class _SealedWithMethodsChild2() : _SealedClassWithMethods() {
fun m2() = this.hashCode().toString()
}
class _SealedWithMethodsChild3() : _SealedClassWithMethods() {
fun m3() = this.hashCode().toString()
}
sealed class _SealedClassMixed
data class _SealedMixedChild1(val number: Int) : _SealedClassMixed()
data class _SealedMixedChild2(val e1: Int, val e2: Int) : _SealedClassMixed()
data class _SealedMixedChild3(val m1: Int, val m2: Int) : _SealedClassMixed()
object _SealedMixedChildObject1 : _SealedClassMixed()
object _SealedMixedChildObject2 : _SealedClassMixed()
object _SealedMixedChildObject3 : _SealedClassMixed()
@@ -0,0 +1,4 @@
typealias _TypeAliasAny = Any
typealias _TypeAliasUnit = Unit
typealias _TypeAliasNothing = Nothing
typealias _TypeAliasInt = Int