failing test
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
fun f(x: Int, b: Boolean): Int {
|
||||||
|
var result = x;
|
||||||
|
if (b) else result = result + 5;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -180,6 +180,14 @@ public class NamespaceGenTest extends LightCodeInsightFixtureTestCase {
|
|||||||
binOpTest("fun foo(a: Int, b: Int): Int = a % b", 14, 3, 2);
|
binOpTest("fun foo(a: Int, b: Int): Int = a % b", 14, 3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testIfNoElse() throws Exception {
|
||||||
|
loadFile("ifNoElse.jet");
|
||||||
|
System.out.println(generateToText());
|
||||||
|
final Method main = generateFunction();
|
||||||
|
assertEquals(5, main.invoke(null, 5, true));
|
||||||
|
assertEquals(10, main.invoke(null, 5, false));
|
||||||
|
}
|
||||||
|
|
||||||
private void binOpTest(final String text, final int arg1, final int arg2, final int expected) throws Exception {
|
private void binOpTest(final String text, final int arg1, final int arg2, final int expected) throws Exception {
|
||||||
loadText(text);
|
loadText(text);
|
||||||
System.out.println(generateToText());
|
System.out.println(generateToText());
|
||||||
|
|||||||
Reference in New Issue
Block a user