file_mult avoided

This commit is contained in:
Sergey Ignatov
2011-11-07 13:11:33 +04:00
parent 9c0ac7b31c
commit 58e8aa8fbb
13 changed files with 34 additions and 10 deletions
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
rm `find "testData" -name "*.kt.tmp"`
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
rename -f s/.kt.tmp/.kt/ `find "testData" -name "*.kt.tmp"`
@@ -13,6 +13,7 @@ import java.io.File;
import java.io.IOException;
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.apache.commons.io.FileUtils.writeStringToFile;
import static org.jetbrains.jet.j2k.TestCaseBuilder.getTestDataPathBase;
/**
@@ -48,10 +49,11 @@ public class JavaToKotlinConverterTest extends LightDaemonAnalyzerTestCase {
else if (javaFile.getParent().endsWith("/class")) actual = classToSingleLineKotlin(javaCode);
else if (javaFile.getParent().endsWith("/class_mult")) actual = classToKotlin(javaCode);
else if (javaFile.getParent().endsWith("/file")) actual = fileToSingleLineKotlin(javaCode);
else if (javaFile.getParent().endsWith("/file_mult")) actual = fileToKotlin(javaCode);
else if (javaFile.getParent().endsWith("/file")) actual = fileToKotlin(javaCode);
assert !actual.equals("");
if (!expected.equals(actual))
writeStringToFile(new File(kotlinPath + ".tmp"), actual);
Assert.assertEquals(expected, actual);
}
@@ -99,10 +101,6 @@ public class JavaToKotlinConverterTest extends LightDaemonAnalyzerTestCase {
return prettify(Converter.fileToFile((PsiJavaFile) myFile).toKotlin());
}
protected String fileToSingleLineKotlin(String text) throws IOException {
return toSingleLine(fileToKotlin(text));
}
@NotNull
protected String classToKotlin(String text) throws IOException {
configureFromText(text);
+4 -1
View File
@@ -1 +1,4 @@
namespace test { class C { } }
namespace test {
class C {
}
}
+6 -1
View File
@@ -1 +1,6 @@
namespace { class A { } class B { } }
namespace {
class A {
}
class B {
}
}
@@ -1 +1,4 @@
namespace test { open class C { } }
namespace test {
open class C {
}
}
+10 -1
View File
@@ -1 +1,10 @@
namespace { open class A { fun a() : Unit { } } class B : A { override fun a() : Unit { } } }
namespace {
open class A {
fun a() : Unit {
}
}
class B : A {
override fun a() : Unit {
}
}
}