put values of correct type on stack for checking if character is in range
This commit is contained in:
@@ -155,7 +155,12 @@ public abstract class CodegenTestCase extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
protected Method generateFunction() {
|
||||
Class aClass = generateNamespaceClass();
|
||||
return aClass.getMethods()[0];
|
||||
try {
|
||||
return aClass.getMethods()[0];
|
||||
} catch (Error e) {
|
||||
System.out.println(generateToText());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
protected Method generateFunction(String name) {
|
||||
|
||||
@@ -42,6 +42,14 @@ public class PatternMatchingTest extends CodegenTestCase {
|
||||
assertEquals("something", foo.invoke(null, 19));
|
||||
}
|
||||
|
||||
public void testRangeChar() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertEquals("digit", foo.invoke(null, '0'));
|
||||
assertEquals("something", foo.invoke(null, 'A'));
|
||||
}
|
||||
|
||||
public void testWildcardPattern() throws Exception {
|
||||
loadText("fun foo(x: String) = when(x) { is * => \"something\" }");
|
||||
Method foo = generateFunction();
|
||||
|
||||
Reference in New Issue
Block a user