1st test for traits work
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
trait SimpleClass : java.lang.Object {
|
||||
fun foo() : String = "239 " + toString ()
|
||||
}
|
||||
|
||||
class SimpleClassImpl() : SimpleClass {
|
||||
override fun toString() = "SimpleClassImpl"
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val c = SimpleClassImpl()
|
||||
return if("239 SimpleClassImpl" == c.foo()) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
public class TraitsTest extends CodegenTestCase {
|
||||
@Override
|
||||
protected String getPrefix() {
|
||||
return "traits";
|
||||
}
|
||||
|
||||
public void testSimple () throws Exception {
|
||||
blackBoxFile("traits/simple.jet");
|
||||
System.out.println(generateToText());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user