[Lombok] Adapt format of codegen tests to standard box() style
This commit is contained in:
committed by
teamcity
parent
bc8051ce9b
commit
dcd96932aa
+6
-6
@@ -3,7 +3,8 @@
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.*;
|
import lombok.experimental.*;
|
||||||
|
|
||||||
@Getter @Setter
|
@Getter
|
||||||
|
@Setter
|
||||||
@Accessors(prefix = { "f", "field" })
|
@Accessors(prefix = { "f", "field" })
|
||||||
public class AccessorsTest {
|
public class AccessorsTest {
|
||||||
// @Accessors
|
// @Accessors
|
||||||
@@ -17,7 +18,8 @@ public class AccessorsTest {
|
|||||||
@Accessors
|
@Accessors
|
||||||
private Boolean isNonPrimitiveHuman;
|
private Boolean isNonPrimitiveHuman;
|
||||||
|
|
||||||
static void test() {
|
static void test()
|
||||||
|
{
|
||||||
val obj = new AccessorsTest ();
|
val obj = new AccessorsTest ();
|
||||||
|
|
||||||
// obj.getAge();
|
// obj.getAge();
|
||||||
@@ -44,8 +46,7 @@ public class AccessorsTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = AccessorsTest()
|
val obj = AccessorsTest()
|
||||||
|
|
||||||
// obj.getAge()
|
// obj.getAge()
|
||||||
@@ -66,6 +67,5 @@ class Test {
|
|||||||
obj.getIsNonPrimitiveHuman()
|
obj.getIsNonPrimitiveHuman()
|
||||||
obj.setIsNonPrimitiveHuman(false)
|
obj.setIsNonPrimitiveHuman(false)
|
||||||
|
|
||||||
}
|
return "OK"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,15 +15,13 @@ public class PrefixJava {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
//not generated because doesn't have prefix from class level @Accessors
|
//not generated because doesn't have prefix from class level @Accessors
|
||||||
//assertEquals(PrefixJava().propA, "A")
|
//assertEquals(PrefixJava().propA, "A")
|
||||||
//not generated because doesn't have prefix from config
|
//not generated because doesn't have prefix from config
|
||||||
//assertEquals(PrefixJava().propC, "C")
|
//assertEquals(PrefixJava().propC, "C")
|
||||||
assertEquals(PrefixJava().propD, "D")
|
assertEquals(PrefixJava().propD, "D")
|
||||||
}
|
return "OK"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//FILE: lombok.config
|
//FILE: lombok.config
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ public class AccessorsTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = AccessorsTest()
|
val obj = AccessorsTest()
|
||||||
|
|
||||||
// obj.getAge()
|
// obj.getAge()
|
||||||
@@ -64,9 +63,7 @@ class Test {
|
|||||||
|
|
||||||
obj.getIsNonPrimitiveHuman()
|
obj.getIsNonPrimitiveHuman()
|
||||||
obj.setIsNonPrimitiveHuman(false)
|
obj.setIsNonPrimitiveHuman(false)
|
||||||
|
return "OK"
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//FILE: lombok.config
|
//FILE: lombok.config
|
||||||
|
|||||||
+2
-3
@@ -19,8 +19,7 @@ public class ConstructorExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val generated = ConstructorExample(12, "sdf", true)
|
val generated = ConstructorExample(12, "sdf", true)
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ public class ConstructorExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val existing: ConstructorExample = ConstructorExample("existing")
|
val existing: ConstructorExample = ConstructorExample("existing")
|
||||||
val generated: ConstructorExample = ConstructorExample.of(45, "234", false)
|
val generated: ConstructorExample = ConstructorExample.of(45, "234", false)
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -79,8 +79,7 @@ class KotlinChildClass : ClashTest() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = ClashTest()
|
val obj = ClashTest()
|
||||||
|
|
||||||
obj.getAge()
|
obj.getAge()
|
||||||
@@ -106,5 +105,5 @@ class Test {
|
|||||||
childObj.setToOverride(34)
|
childObj.setToOverride(34)
|
||||||
childObj.toOverride
|
childObj.toOverride
|
||||||
childObj.toOverride = 412
|
childObj.toOverride = 412
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -19,13 +19,12 @@ public class GetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterTest()
|
val obj = GetterTest()
|
||||||
val ref: GetterTest = obj.name("some").age(34)
|
val ref: GetterTest = obj.name("some").age(34)
|
||||||
obj.name()
|
obj.name()
|
||||||
obj.age()
|
obj.age()
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
//FILE: lombok.config
|
//FILE: lombok.config
|
||||||
|
|||||||
@@ -22,13 +22,12 @@ public class GetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterTest()
|
val obj = GetterTest()
|
||||||
val ref: GetterTest = obj.fluent(true)
|
val ref: GetterTest = obj.fluent(true)
|
||||||
obj.name()
|
obj.name()
|
||||||
obj.age()
|
obj.age()
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
//FILE: lombok.config
|
//FILE: lombok.config
|
||||||
|
|||||||
@@ -15,13 +15,12 @@ public class GetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterTest()
|
val obj = GetterTest()
|
||||||
|
|
||||||
obj.primitiveBoolean
|
obj.primitiveBoolean
|
||||||
obj.getPrimitiveBoolean()
|
obj.getPrimitiveBoolean()
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
//FILE: lombok.config
|
//FILE: lombok.config
|
||||||
|
|||||||
+2
-3
@@ -15,13 +15,12 @@ public class GetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterTest()
|
val obj = GetterTest()
|
||||||
|
|
||||||
obj.primitiveBoolean
|
obj.primitiveBoolean
|
||||||
obj.getPrimitiveBoolean()
|
obj.getPrimitiveBoolean()
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
//FILE: lombok.config
|
//FILE: lombok.config
|
||||||
|
|||||||
+2
-3
@@ -27,8 +27,7 @@ import lombok.*;
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = DataExample("name")
|
val obj = DataExample("name")
|
||||||
obj.getName()
|
obj.getName()
|
||||||
assertEquals(obj.name, "name")
|
assertEquals(obj.name, "name")
|
||||||
@@ -40,5 +39,5 @@ class Test {
|
|||||||
assertEquals(obj.score, 2.5)
|
assertEquals(obj.score, 2.5)
|
||||||
|
|
||||||
val ex: DataExample.Exercise<Int> = DataExample.Exercise.of("name", 12)
|
val ex: DataExample.Exercise<Int> = DataExample.Exercise.of("name", 12)
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -26,13 +26,13 @@ public class GenericsTest<A, B> {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GenericsTest<String, Boolean>()
|
val obj = GenericsTest<String, Boolean>()
|
||||||
val age: Int = obj.getAge();
|
val age: Int = obj.getAge();
|
||||||
obj.setFieldA("fooo");
|
obj.setFieldA("fooo");
|
||||||
val a: String = obj.getFieldA();
|
val a: String = obj.getFieldA();
|
||||||
val b: Boolean? = obj.getFieldB();
|
val b: Boolean? = obj.getFieldB();
|
||||||
obj.setFieldC(java.util.HashMap<String, Boolean>());
|
obj.setFieldC(java.util.HashMap<String, Boolean>());
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+2
-3
@@ -21,9 +21,8 @@ public class ConstructorExample<A, B> {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val generated = ConstructorExample<Long, Boolean>(12, 42L, true)
|
val generated = ConstructorExample<Long, Boolean>(12, 42L, true)
|
||||||
val generatedReq = ConstructorExample<String, Boolean>("234");
|
val generatedReq = ConstructorExample<String, Boolean>("234");
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,10 @@ public class ConstructorExample<A, B> {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val generated: ConstructorExample<Long, Boolean> = ConstructorExample.of(12, 42L, true)
|
val generated: ConstructorExample<Long, Boolean> = ConstructorExample.of(12, 42L, true)
|
||||||
assertEquals(generated.name, 42L)
|
assertEquals(generated.name, 42L)
|
||||||
val generatedReq: ConstructorExample<String, Boolean> = ConstructorExample.of("234")
|
val generatedReq: ConstructorExample<String, Boolean> = ConstructorExample.of("234")
|
||||||
assertEquals(generatedReq.name, "234")
|
assertEquals(generatedReq.name, "234")
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -25,13 +25,12 @@ public class GetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterTest()
|
val obj = GetterTest()
|
||||||
val getter = obj.getAge()
|
val getter = obj.getAge()
|
||||||
val property = obj.age
|
val property = obj.age
|
||||||
|
|
||||||
//todo kotlin doesn't see isBoolean methods as property
|
//todo kotlin doesn't seee isBoolean methods as property
|
||||||
// obj.primitiveBoolean
|
// obj.primitiveBoolean
|
||||||
obj.isPrimitiveBoolean()
|
obj.isPrimitiveBoolean()
|
||||||
|
|
||||||
@@ -44,6 +43,7 @@ class Test {
|
|||||||
// obj.getInvisible()
|
// obj.getInvisible()
|
||||||
|
|
||||||
OverridenGetterTest().usage()
|
OverridenGetterTest().usage()
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverridenGetterTest : GetterTest() {
|
class OverridenGetterTest : GetterTest() {
|
||||||
@@ -51,4 +51,4 @@ class Test {
|
|||||||
getName()
|
getName()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+2
-3
@@ -23,8 +23,7 @@ public class ClassLevelGetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = ClassLevelGetterTest()
|
val obj = ClassLevelGetterTest()
|
||||||
val getter = obj.getAge()
|
val getter = obj.getAge()
|
||||||
val property = obj.age
|
val property = obj.age
|
||||||
@@ -38,6 +37,7 @@ class Test {
|
|||||||
// obj.getName()
|
// obj.getName()
|
||||||
|
|
||||||
OverridenGetterTest().usage()
|
OverridenGetterTest().usage()
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverridenGetterTest : ClassLevelGetterTest() {
|
class OverridenGetterTest : ClassLevelGetterTest() {
|
||||||
@@ -45,4 +45,3 @@ class Test {
|
|||||||
getName()
|
getName()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+2
-3
@@ -27,8 +27,7 @@ public class FluentTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = FluentTest()
|
val obj = FluentTest()
|
||||||
assertEquals(obj.age(), 10)
|
assertEquals(obj.age(), 10)
|
||||||
|
|
||||||
@@ -40,6 +39,7 @@ class Test {
|
|||||||
obj.getOverrideAnnotation()
|
obj.getOverrideAnnotation()
|
||||||
|
|
||||||
OverridenGetterTest().usage()
|
OverridenGetterTest().usage()
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverridenGetterTest : FluentTest() {
|
class OverridenGetterTest : FluentTest() {
|
||||||
@@ -47,4 +47,3 @@ class Test {
|
|||||||
name()
|
name()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+3
-3
@@ -22,9 +22,9 @@ public class ConstructorExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val existing = ConstructorExample("existing")
|
val existing = ConstructorExample("existing")
|
||||||
val generated = ConstructorExample()
|
val generated = ConstructorExample()
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public class ConstructorExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val existing: ConstructorExample = ConstructorExample("existing")
|
val existing: ConstructorExample = ConstructorExample("existing")
|
||||||
val generated: ConstructorExample = ConstructorExample.make()
|
val generated: ConstructorExample = ConstructorExample.make()
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+2
-3
@@ -14,10 +14,9 @@ public class GetterSetterExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterSetterExample()
|
val obj = GetterSetterExample()
|
||||||
val age: Int = obj.getAge()
|
val age: Int = obj.getAge()
|
||||||
val name: String? = obj.getName()
|
val name: String? = obj.getName()
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ public class Foo {
|
|||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
@Anno
|
@Anno
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = Foo()
|
val obj = Foo()
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -13,8 +13,7 @@ public class ChildClass extends ParentClass {}
|
|||||||
|
|
||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
ChildClass::class
|
ChildClass::class
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,9 @@ public class ConstructorExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val generated = ConstructorExample("foo", true)
|
val generated = ConstructorExample("foo", true)
|
||||||
assertEquals(generated.foo, "foo")
|
assertEquals(generated.foo, "foo")
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,9 +35,8 @@ public class ConstructorExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val generated = ConstructorExample.build("foo", true, 12)
|
val generated = ConstructorExample.build("foo", true, 12)
|
||||||
assertEquals(generated.foo, "foo")
|
assertEquals(generated.foo, "foo")
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -20,8 +20,7 @@ public class SetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = SetterTest()
|
val obj = SetterTest()
|
||||||
obj.setAge(42)
|
obj.setAge(42)
|
||||||
obj.age = 42
|
obj.age = 42
|
||||||
@@ -34,6 +33,7 @@ class Test {
|
|||||||
// obj.setName("abc")
|
// obj.setName("abc")
|
||||||
|
|
||||||
OverridenGetterTest().usage()
|
OverridenGetterTest().usage()
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverridenGetterTest : SetterTest() {
|
class OverridenGetterTest : SetterTest() {
|
||||||
@@ -41,4 +41,3 @@ class Test {
|
|||||||
setName("abc")
|
setName("abc")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+3
-4
@@ -23,8 +23,7 @@ public class SetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = SetterTest()
|
val obj = SetterTest()
|
||||||
obj.setAge(42)
|
obj.setAge(42)
|
||||||
assertEquals(obj.age, 42)
|
assertEquals(obj.age, 42)
|
||||||
@@ -33,8 +32,8 @@ class Test {
|
|||||||
|
|
||||||
obj.setPrimitiveBoolean(true)
|
obj.setPrimitiveBoolean(true)
|
||||||
|
|
||||||
|
|
||||||
// no setters generated for final variable
|
// no setters generated for final variable
|
||||||
// obj.setFinalName("error")
|
// obj.setFinalName("error")
|
||||||
|
return "OK"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+2
-4
@@ -25,8 +25,7 @@ public class SetterTest {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = SetterTest()
|
val obj = SetterTest()
|
||||||
obj.fluent(12)
|
obj.fluent(12)
|
||||||
assertEquals(obj.fluent(), 12)
|
assertEquals(obj.fluent(), 12)
|
||||||
@@ -34,6 +33,5 @@ class Test {
|
|||||||
assertEquals(obj.getChained(), "zz")
|
assertEquals(obj.getChained(), "zz")
|
||||||
obj.whyNotBoth("zzz").whyNotBoth()
|
obj.whyNotBoth("zzz").whyNotBoth()
|
||||||
assertEquals(obj.whyNotBoth(), "zzz")
|
assertEquals(obj.whyNotBoth(), "zzz")
|
||||||
}
|
return "OK"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -13,10 +13,9 @@ public class GetterSetterExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = GetterSetterExample()
|
val obj = GetterSetterExample()
|
||||||
val getter = obj.getAge()
|
val getter = obj.getAge()
|
||||||
val property = obj.age
|
val property = obj.age
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -28,8 +28,7 @@ import lombok.*;
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
fun run() {
|
|
||||||
val obj = ValueExample("name", 12, 4.5)
|
val obj = ValueExample("name", 12, 4.5)
|
||||||
assertEquals(obj.getName(), "name")
|
assertEquals(obj.getName(), "name")
|
||||||
assertEquals(obj.name, "name")
|
assertEquals(obj.name, "name")
|
||||||
@@ -40,5 +39,5 @@ class Test {
|
|||||||
val ex: ValueExample.Exercise<Int> = ValueExample.Exercise.of("nam1e", 42)
|
val ex: ValueExample.Exercise<Int> = ValueExample.Exercise.of("nam1e", 42)
|
||||||
assertEquals(ex.name, "nam1e")
|
assertEquals(ex.name, "nam1e")
|
||||||
assertEquals(ex.value, 42)
|
assertEquals(ex.value, 42)
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -18,11 +18,9 @@ public class WithExample {
|
|||||||
|
|
||||||
//FILE: test.kt
|
//FILE: test.kt
|
||||||
|
|
||||||
class Test {
|
fun box(): String {
|
||||||
|
|
||||||
fun run() {
|
|
||||||
val obj: WithExample = WithExample().withAge(16).withName("fooo")
|
val obj: WithExample = WithExample().withAge(16).withName("fooo")
|
||||||
assertEquals(obj.getName(), "fooo")
|
assertEquals(obj.getName(), "fooo")
|
||||||
assertEquals(obj.age, 16)
|
assertEquals(obj.age, 16)
|
||||||
}
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user