Minor refactorings in legacy codegen tests

Use loadFile() + getPrefix() instead of loadFile(String)
This commit is contained in:
Alexander Udalov
2016-02-23 17:56:28 +03:00
parent 5f7bc601a8
commit 1be6046fc2
9 changed files with 65 additions and 49 deletions
@@ -53,19 +53,19 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testWhile() throws Exception {
factorialTest("controlStructures/while.kt");
factorialTest();
}
public void testDoWhile() throws Exception {
factorialTest("controlStructures/doWhile.kt");
factorialTest();
}
public void testBreak() throws Exception {
factorialTest("controlStructures/break.kt");
factorialTest();
}
private void factorialTest(String name) throws Exception {
loadFile(name);
private void factorialTest() throws Exception {
loadFile();
Method main = generateFunction();
assertEquals(6, main.invoke(null, 3));
assertEquals(120, main.invoke(null, 5));