Refactor ClassGenTest
Initialize environment with JDK_ONLY in setUp(), allowing to quickly launch tests without compilation of stdlib. Remove duplicate/unneeded/commented out tests
This commit is contained in:
@@ -1,23 +1,14 @@
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
|
||||
public object RefreshQueue {
|
||||
private val queue = ConcurrentLinkedQueue<List<String>>
|
||||
|
||||
private val workerThread = Thread(object : Runnable {
|
||||
object RefreshQueue {
|
||||
val workerThread: Thread = Thread(object : Runnable {
|
||||
override fun run() {
|
||||
while (!workerThread.isInterrupted()) {
|
||||
try {
|
||||
// synchronized(queue) {
|
||||
// queue.wait()
|
||||
// }
|
||||
} catch (e : InterruptedException) {
|
||||
}
|
||||
}
|
||||
val a = workerThread
|
||||
val b = RefreshQueue.workerThread
|
||||
if (a != b) throw AssertionError()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val t = RefreshQueue.workerThread
|
||||
RefreshQueue.workerThread.run()
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import java.util.HashMap
|
||||
|
||||
data class Pair<First, Second>(val first: First, val second: Second)
|
||||
|
||||
fun parseCatalogs(hashMap: Any?) {
|
||||
val r = toHasMap(hashMap)
|
||||
if (!r.first) {
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
class SimpleClass() : java.lang.Object() {
|
||||
fun foo() : String = "610" + toString ()
|
||||
|
||||
override fun toString() : String { return foo() }
|
||||
trait Trait {
|
||||
fun foo() = "O"
|
||||
fun toString() = "K"
|
||||
}
|
||||
|
||||
class ComplexClass() : SimpleClass by delegate {
|
||||
val delegate = SimpleClass()
|
||||
override fun toString() : String { return foo() + " complex" }
|
||||
class SimpleClass : Trait
|
||||
|
||||
class ComplexClass : Trait by SimpleClass() {
|
||||
override fun toString() = foo() + super.toString()
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val c = SimpleClass()
|
||||
val d = ComplexClass()
|
||||
System.out?.println(d)
|
||||
return c.foo()
|
||||
}
|
||||
fun box() = ComplexClass().toString()
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package org2
|
||||
|
||||
enum class Test {
|
||||
A
|
||||
B
|
||||
C
|
||||
}
|
||||
|
||||
fun box() = Test.A.toString()
|
||||
@@ -1,7 +0,0 @@
|
||||
package container_test
|
||||
|
||||
class Container<T>(var t : T) {
|
||||
fun getT() : T = t
|
||||
}
|
||||
|
||||
fun box() = Container<String>("OK").getT()
|
||||
Reference in New Issue
Block a user