Same file separators for generation tests on windows

This commit is contained in:
Nikolay Krasko
2012-06-27 17:39:45 +04:00
parent 0e07358362
commit 5ab1c796e0
3 changed files with 8 additions and 2 deletions
@@ -18,6 +18,8 @@ package org.jetbrains.jet.test.generator;
import org.jetbrains.annotations.NotNull;
import java.io.File;
/**
* @author abreslav
*/
@@ -57,4 +59,8 @@ public class Printer {
indent = indent.substring(INDENTATION_UNIT.length());
}
public static String getFilePath(File file) {
return file.getPath().replaceAll("\\\\", "/");
}
}
@@ -34,7 +34,7 @@ public class TestDataFile {
}
public String getTestCall() {
return doTestMethodName + "(\"" + file + "\");";
return doTestMethodName + "(\"" + Printer.getFilePath(file) + "\");";
}
public String getTestMethodName() {
@@ -74,7 +74,7 @@ public class TestDataSource {
}
public void getAllTestsPresentCheck(@NotNull Printer p) {
p.println("allTestsPresent(" + getTestClassName() + ".class, new File(\"" + rootFile + "\"), " + recursive + ");");
p.println("allTestsPresent(" + getTestClassName() + ".class, new File(\"" + Printer.getFilePath(rootFile) + "\"), " + recursive + ");");
}
public String getAllTestsPresentMethodName() {