Added test which should be enabled after fixing bug in front-end.
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class Container {
|
||||
@NotNull
|
||||
Value get(Runnable i) {
|
||||
i.run();
|
||||
return new Value();
|
||||
}
|
||||
|
||||
void set(Runnable i, @NotNull Value value) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
|
||||
class Value {
|
||||
@NotNull Value plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
fun box(): String {
|
||||
var c = Container()
|
||||
var indexAccess = 0
|
||||
|
||||
// TODO uncomment when KT-3723 is fixed
|
||||
|
||||
//var v1 = "FAIL"
|
||||
//c[{ indexAccess++ }] += { v1 = "OK" }
|
||||
//if (v1 != "OK") return "plus: $v1"
|
||||
//
|
||||
//var v2 = "FAIL"
|
||||
//c[{ indexAccess++ }] -= { v2 = "OK" }
|
||||
//if (v2 != "OK") return "minus: $v2"
|
||||
//
|
||||
//var v3 = "FAIL"
|
||||
//c[{ indexAccess++ }] *= { v3 = "OK" }
|
||||
//if (v3 != "OK") return "times: $v3"
|
||||
//
|
||||
//var v4 = "FAIL"
|
||||
//c[{ indexAccess++ }] /= { v4 = "OK" }
|
||||
//if (v4 != "OK") return "div: $v4"
|
||||
//
|
||||
//var v5 = "FAIL"
|
||||
//c[{ indexAccess++ }] %= { v5 = "OK" }
|
||||
//if (v5 != "OK") return "mod: $v5"
|
||||
//
|
||||
//if (indexAccess != 10) return indexAccess
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
-1
@@ -232,6 +232,11 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/boxWithJava/samAdapters/operators"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("augmentedAssignmentAndSquareBrackets.kt")
|
||||
public void testAugmentedAssignmentAndSquareBrackets() throws Exception {
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/operators/augmentedAssignmentAndSquareBrackets.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("augmentedAssignmentPure.kt")
|
||||
public void testAugmentedAssignmentPure() throws Exception {
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/operators/augmentedAssignmentPure.kt");
|
||||
@@ -266,7 +271,7 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
|
||||
public void testInfixCall() throws Exception {
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/operators/infixCall.kt");
|
||||
}
|
||||
|
||||
|
||||
@TestMetadata("invoke.kt")
|
||||
public void testInvoke() throws Exception {
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/operators/invoke.kt");
|
||||
|
||||
Reference in New Issue
Block a user