Copy dropped method nameToCompare() to test utils
This commit is contained in:
committed by
Dmitry Jemerov
parent
9f51b12193
commit
d5aac7df25
@@ -26,6 +26,7 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.ShutDownTracker;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
@@ -928,7 +929,7 @@ public class KotlinTestUtils {
|
||||
private static void assertFilePathPresent(File file, File rootFile, Set<String> filePaths) {
|
||||
String path = FileUtil.getRelativePath(rootFile, file);
|
||||
if (path != null) {
|
||||
String relativePath = FileUtil.nameToCompare(path);
|
||||
String relativePath = nameToCompare(path);
|
||||
if (!filePaths.contains(relativePath)) {
|
||||
Assert.fail("Test data file missing from the generated test class: " + file + "\n" + PLEASE_REGENERATE_TESTS);
|
||||
}
|
||||
@@ -940,7 +941,7 @@ public class KotlinTestUtils {
|
||||
ContainerUtil.map(collectMethodsMetadata(testCaseClass), new Function<String, String>() {
|
||||
@Override
|
||||
public String fun(String pathData) {
|
||||
return FileUtil.nameToCompare(pathData);
|
||||
return nameToCompare(pathData);
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -1043,4 +1044,8 @@ public class KotlinTestUtils {
|
||||
//noinspection SpellCheckingInspection
|
||||
return testName.toLowerCase().startsWith("allfilespresentin");
|
||||
}
|
||||
|
||||
public static String nameToCompare(@NotNull String name) {
|
||||
return (SystemInfo.isFileSystemCaseSensitive ? name : name.toLowerCase()).replace('\\', '/');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user