KT-621 Remove .foo() pattern matching from when (Some tests were rewritten)

This commit is contained in:
Nikolay Krasko
2011-11-25 17:39:16 +04:00
parent 0b689f32a7
commit 0c758902ef
21 changed files with 256 additions and 294 deletions
@@ -99,18 +99,19 @@ public class PatternMatchingTest extends CodegenTestCase {
assertEquals("something", foo.invoke(null, new Tuple2<String, String>(null, "not", "tuple")));
}
public void testCall() throws Exception {
loadText("fun foo(s: String) = when(s) { .startsWith(\"J\") => \"JetBrains\"; else => \"something\" }");
Method foo = generateFunction();
try {
assertEquals("JetBrains", foo.invoke(null, "Java"));
assertEquals("something", foo.invoke(null, "C#"));
}
catch (Throwable t) {
System.out.println(generateToText());
t.printStackTrace();
}
}
// Commented for KT-621
// public void testCall() throws Exception {
// loadText("fun foo(s: String) = when(s) { .startsWith(\"J\") => \"JetBrains\"; else => \"something\" }");
// Method foo = generateFunction();
// 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 {
blackBoxFile("patternMatching/callProperty.jet");