提交 806bddb8 编写于 作者: D Dmitry Jemerov

fixed tests

上级 eb7ac0cf
......@@ -34,15 +34,17 @@ public class PrimitiveTypesTest extends CodegenTestCase {
}
public void testNE() throws Exception {
final String code = "fun foo(a: Int, b: Int): Int = if (a != b) 1 else 0";
binOpTest(code, 5, 5, 0);
binOpTest(code, 5, 3, 1);
loadText("fun foo(a: Int, b: Int): Int = if (a != b) 1 else 0");
final Method main = generateFunction();
assertEquals(0, main.invoke(null, 5, 5));
assertEquals(1, main.invoke(null, 5, 3));
}
public void testGE() throws Exception {
final String code = "fun foo(a: Int, b: Int): Int = if (a >= b) 1 else 0";
binOpTest(code, 5, 5, 1);
binOpTest(code, 3, 5, 0);
loadText("fun foo(a: Int, b: Int): Int = if (a >= b) 1 else 0");
final Method main = generateFunction();
assertEquals(1, main.invoke(null, 5, 5));
assertEquals(0, main.invoke(null, 3, 5));
}
public void testReturnCmp() throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册