initial commit for j2k

This commit is contained in:
Sergey Ignatov
2011-10-27 17:27:15 +04:00
commit 8cf4c80951
53 changed files with 2248 additions and 0 deletions
@@ -0,0 +1,44 @@
package org.jetbrains.jet.j2k.ast;
import junit.framework.Assert;
import org.jetbrains.jet.j2k.JetTestCaseBase;
/**
* @author ignatov
*/
public class FunctionTest extends JetTestCaseBase {
public void testEmptyVoidMethod() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("void main() {}"),
"fun main() : Unit { }"
);
}
public void testMethodClassType() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("String main() {}"),
"fun main() : String? { }"
);
}
public void testMethodPrimitiveType() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("int main() {}"),
"fun main() : Int { }"
);
}
public void testMethodPrimitiveType2() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("boolean main() {}"),
"fun main() : Boolean { }"
);
}
public void testMethodWithReturnStatement() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("boolean isTrue() { return true; }"),
"fun isTrue() : Boolean { return true }"
);
}
}