[K/N][tests] Migrate link tests to new testing infra ^KT-61259
This commit is contained in:
committed by
Space Team
parent
588549d1d0
commit
d6a922bc74
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package foo.bar
|
||||
|
||||
class R<T> {
|
||||
inline fun bar(t: T) {
|
||||
println("just a single class: $t")
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
inline fun foo() {
|
||||
println("first level")
|
||||
}
|
||||
|
||||
class D {
|
||||
inline fun foo() {
|
||||
println("second level")
|
||||
}
|
||||
|
||||
class E {
|
||||
inline fun foo() {
|
||||
println("third levelxz")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C2 {
|
||||
inline fun foo() {
|
||||
println("inner first level")
|
||||
}
|
||||
|
||||
inner class D2 {
|
||||
inline fun foo() {
|
||||
println("inner second level")
|
||||
}
|
||||
|
||||
inner class E2 {
|
||||
inline fun foo() {
|
||||
println("inner third level")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C3<X> {
|
||||
inline fun foo(x: X) {
|
||||
println("types first level: $x")
|
||||
}
|
||||
|
||||
class D3<X> {
|
||||
inline fun foo(x: X) {
|
||||
println("types second level $x")
|
||||
}
|
||||
|
||||
class E3<X> {
|
||||
inline fun foo(x: X) {
|
||||
println("types third level $x")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C4<X> {
|
||||
inline fun foo(x: X) {
|
||||
println("inner types first level: $x")
|
||||
}
|
||||
|
||||
inner class D4<Y> {
|
||||
inline fun foo(x: X, y: Y) {
|
||||
println("inner types second level $x, $y")
|
||||
}
|
||||
|
||||
inner class E4<Z> {
|
||||
inline fun foo(x: X, y: Y, z: Z) {
|
||||
println("inner types third level $x, $y, $z")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
import foo.bar.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val c = C()
|
||||
val d = C.D()
|
||||
val e = C.D.E()
|
||||
c.foo()
|
||||
d.foo()
|
||||
e.foo()
|
||||
|
||||
val c2 = C2()
|
||||
val d2 = C2().D2()
|
||||
val e2 = C2().D2().E2()
|
||||
c2.foo()
|
||||
d2.foo()
|
||||
e2.foo()
|
||||
|
||||
val c3 = C3<Int>()
|
||||
val d3 = C3.D3<String>()
|
||||
val e3 = C3.D3.E3<Float>()
|
||||
c3.foo(13)
|
||||
d3.foo("cha-cha-cha")
|
||||
e3.foo(1.0f)
|
||||
|
||||
// This part doesn't work with file local inline functions.
|
||||
// So disabled for now.
|
||||
// val c4 = C4<Int>()
|
||||
// val d4 = C4<String>().D4<Int>()
|
||||
// val e4 = C4<Int>().D4<String>().E4<Int>()
|
||||
// c4.foo(13)
|
||||
// d4.foo("cawabunga", 17)
|
||||
// e4.foo(19, "raqa-taqa", 23)
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
first level
|
||||
second level
|
||||
third levelxz
|
||||
inner first level
|
||||
inner second level
|
||||
inner third level
|
||||
types first level: 13
|
||||
types second level cha-cha-cha
|
||||
types third level 1.0
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
enum class Color {
|
||||
RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW
|
||||
}
|
||||
|
||||
fun determineColor(code: Int): Color = when (code) {
|
||||
0 -> Color.BLUE
|
||||
1 -> Color.MAGENTA
|
||||
else -> Color.CYAN
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println(Color.RED.ordinal)
|
||||
println(Color.GREEN.ordinal)
|
||||
println(Color.BLUE.ordinal)
|
||||
val color = when (determineColor(args.size)) {
|
||||
Color.RED -> println("r")
|
||||
Color.GREEN -> println("g")
|
||||
Color.BLUE -> println("b")
|
||||
Color.CYAN -> println("c")
|
||||
Color.MAGENTA -> println("m")
|
||||
Color.YELLOW -> println("y")
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
0
|
||||
1
|
||||
2
|
||||
b
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
inline fun foo() {
|
||||
try {
|
||||
try {
|
||||
throw Exception("XXX")
|
||||
} catch (e: Throwable) {
|
||||
println("Gotcha1: ${e.message}")
|
||||
throw Exception("YYY")
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
println("Gotcha2: ${e.message}")
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo()
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Gotcha1: XXX
|
||||
Gotcha2: YYY
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
inline fun foo(x: Char = '\u042b') = x
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println(foo())
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
Ы
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
inline val Int.prop get() = SomeDataClass(second = this)
|
||||
|
||||
data class SomeDataClass(val first: Int = 17, val second: Int = 19, val third: Int = 23)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println(666.prop)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
SomeDataClass(first=17, second=666, third=23)
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
inline fun foo() {
|
||||
do {
|
||||
var x: Int = 999
|
||||
println(x)
|
||||
} while (x != 999)
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo()
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
999
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
fun bar(vararg x: Int) {
|
||||
x.forEach {
|
||||
println(it)
|
||||
}
|
||||
println("size: ${x.size}")
|
||||
}
|
||||
|
||||
inline fun foo() = bar(17, 19, 23, *intArrayOf(29, 31))
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo()
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
17
|
||||
19
|
||||
23
|
||||
29
|
||||
31
|
||||
size: 5
|
||||
Reference in New Issue
Block a user