[Lombok] Convert tests with compilation errors to diagnostic tests

This commit is contained in:
Dmitriy Novozhilov
2022-05-27 10:53:01 +03:00
committed by teamcity
parent fb57e1ecd5
commit 430ea414a9
42 changed files with 413 additions and 199 deletions
+43
View File
@@ -0,0 +1,43 @@
// FILE: ValueExample.java
import lombok.*;
@Value public class ValueExample {
private final String name;
private int age;
private double score;
@ToString(includeFieldNames=true)
@Value(staticConstructor="of")
public static class Exercise<T> {
private final String name;
private T value;
}
public static void usage() {
val obj = new ValueExample("name", 12, 4.5);
obj.getName();
obj.getAge();
obj.getScore();
Exercise<Integer> ex = Exercise.of("name", 12);
ex.getName();
ex.getValue();
}
}
// FILE: test.kt
fun box(): String {
val obj = ValueExample("name", 12, 4.5)
assertEquals(obj.getName(), "name")
assertEquals(obj.name, "name")
assertEquals(obj.getAge(), 12)
assertEquals(obj.age, 12)
assertEquals(obj.score, 4.5)
val ex: ValueExample.Exercise<Int> = ValueExample.Exercise.of("nam1e", 42)
assertEquals(ex.name, "nam1e")
assertEquals(ex.value, 42)
return "OK"
}