Fix file separators in Codegen Tests on Windows

This commit is contained in:
Natalia Ukhorskaya
2014-07-01 12:14:45 +04:00
parent 261ba0e364
commit 47f4bbedda
@@ -111,8 +111,9 @@ public abstract class CodegenTestCase extends UsefulTestCase {
@NotNull
protected String relativePath(@NotNull File file) {
String stringToCut = "compiler/testData/codegen/";
assert file.getPath().startsWith(stringToCut) : "File path is not absolute: " + file;
return file.getPath().substring(stringToCut.length());
String systemIndependentPath = file.getPath().replace(File.separatorChar, '/');
assert systemIndependentPath.startsWith(stringToCut) : "File path is not absolute: " + file;
return systemIndependentPath.substring(stringToCut.length());
}
@NotNull