fix for KT-237
This commit is contained in:
@@ -144,4 +144,8 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
public void testForUserType() throws Exception {
|
||||
blackBoxFile("controlStructures/forUserType.jet");
|
||||
}
|
||||
|
||||
public void testKt237() throws Exception {
|
||||
blackBoxFile("regressions/kt237.jet");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,8 +448,14 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
public void testPredicateOperator() throws Exception {
|
||||
loadText("fun foo(s: String) = s?startsWith(\"J\")");
|
||||
final Method main = generateFunction();
|
||||
try {
|
||||
assertEquals("JetBrains", main.invoke(null, "JetBrains"));
|
||||
assertNull(main.invoke(null, "IntelliJ"));
|
||||
}
|
||||
catch (Throwable t) {
|
||||
System.out.println(generateToText());
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void testEscapeSequence() throws Exception {
|
||||
|
||||
@@ -80,8 +80,14 @@ public class PatternMatchingTest extends CodegenTestCase {
|
||||
public void testCall() throws Exception {
|
||||
loadText("fun foo(s: String) = when(s) { .startsWith(\"J\") => \"JetBrains\"; else => \"something\" }");
|
||||
Method foo = generateFunction();
|
||||
assertEquals("JetBrains", foo.invoke(null, "Java"));
|
||||
assertEquals("something", foo.invoke(null, "C#"));
|
||||
try {
|
||||
assertEquals("JetBrains", foo.invoke(null, "Java"));
|
||||
assertEquals("something", foo.invoke(null, "C#"));
|
||||
}
|
||||
catch (Throwable t) {
|
||||
System.out.println(generateToText());
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void testCallProperty() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user