KT-1051 Java interoperability completion - enum tests and test for auto import directive auto insert

This commit is contained in:
Nikolay Krasko
2012-02-07 14:05:08 +04:00
parent aa9b2db300
commit ddbd86cdf5
11 changed files with 120 additions and 0 deletions
@@ -0,0 +1,7 @@
public class Testing {
public static void test() {
kotlin.enums.KtEnumColor.<caret>
}
}
// EXIST: RED, GREEN, BLUE
@@ -0,0 +1,7 @@
package kotlin.enums
enum class KtEnumColor(val rgb : Int) {
RED : Color(0xFF0000)
GREEN : Color(0x00FF00)
BLUE : Color(0x0000FF)
}
@@ -0,0 +1,7 @@
public class Testing {
public static void test() {
KtEnum<caret>
}
}
// EXIST: KtEnumDirection, KtEnumColor, KtEnumList
@@ -0,0 +1,31 @@
package kotlin.enums
enum class KtEnumDirection {
NORTH
SOUTH
WEST
EAST
}
enum class KtEnumColor(val rgb : Int) {
RED : Color(0xFF0000)
GREEN : Color(0x00FF00)
BLUE : Color(0x0000FF)
}
//enum class KtEnumProtocolState {
// WAITING {
// override fun signal() = TALKING
// }
//
// TALKING {
// override fun signal() = WAITING
// }
//
// abstract fun signal() : ProtocolState
//}
enum class KtEnumList<out T>(val size : Int) {
Nil : List<Nothing>(0)
Cons<T>(h : T, t : List<T>) : List<T>(t.size + 1)
}
@@ -0,0 +1,7 @@
public class Testing {
public static void main(String[] args) {
kotlin.testing.namespace.<caret>
}
}
// EXIST: someFun
@@ -0,0 +1,5 @@
package kotlin.testing
fun someFun() : Int {
return 12
}
@@ -0,0 +1,7 @@
import jettesting.ClassFromJet;
public class Testing {
public static void test() {
ClassFromJet
}
}
@@ -0,0 +1,5 @@
public class Testing {
public static void test() {
ClassFr<caret>
}
}
@@ -0,0 +1,4 @@
package jettesting
class ClassFromJet {
}