From 99bf9679818c4ca8024e5bcb390b5ae097c6b853 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 8 Apr 2011 16:32:19 +0200 Subject: [PATCH] couple of tests for mixed types in math operations --- .../tests/org/jetbrains/jet/codegen/NamespaceGenTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java b/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java index c44f06049a0..61f6f489448 100644 --- a/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java +++ b/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java @@ -405,6 +405,14 @@ public class NamespaceGenTest extends LightCodeInsightFixtureTestCase { assertEquals(0xffff0000, main.invoke(null, 0x0000ffff)); } + public void testMixedTypes() throws Exception { + binOpTest("fun foo(a: Int, b: Long): Long = a + b", 1, 2L, 3L); + } + + public void testMixedTypes2() throws Exception { + binOpTest("fun foo(a: Double, b: Int): Double = a + b", 1.0, 2, 3.0); + } + private void binOpTest(final String text, final Object arg1, final Object arg2, final Object expected) throws Exception { loadText(text); System.out.println(generateToText());