mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
check for case sensitive fs
This commit is contained in:
@@ -133,6 +133,9 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
final VirtualFile[] vFiles = new VirtualFile[files.length];
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
vFiles[i] = findVirtualFile(files[i]);
|
||||
if (vFiles[i] != null) {
|
||||
VfsTestUtil.assertFilePathEndsWithCaseSensitivePath(vFiles[i], files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
File projectFile = projectRoot == null ? null : new File(getTestDataPath() + projectRoot);
|
||||
@@ -454,6 +457,8 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
|
||||
|
||||
VirtualFile vFile = findVirtualFile(filePath);
|
||||
|
||||
VfsTestUtil.assertFilePathEndsWithCaseSensitivePath(vFile, filePath);
|
||||
String ft;
|
||||
try {
|
||||
ft = VfsUtilCore.loadText(vFile);
|
||||
|
||||
+11
-1
@@ -113,7 +113,9 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
|
||||
*/
|
||||
protected void configureByFile(@TestDataFile @NonNls @NotNull String filePath) {
|
||||
try {
|
||||
final File ioFile = new File(getTestDataPath() + filePath);
|
||||
String fullPath = getTestDataPath() + filePath;
|
||||
final File ioFile = new File(fullPath);
|
||||
checkCaseSensitiveFS(fullPath, ioFile);
|
||||
String fileText = FileUtilRt.loadFile(ioFile, CharsetToolkit.UTF8, true);
|
||||
configureFromFileText(ioFile.getName(), fileText);
|
||||
}
|
||||
@@ -122,6 +124,13 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkCaseSensitiveFS(String fullPath, File ioFile) throws IOException {
|
||||
fullPath = FileUtil.toSystemDependentName(FileUtil.toCanonicalPath(fullPath));
|
||||
if (!ioFile.getCanonicalPath().equals(fullPath)) {
|
||||
throw new RuntimeException("Search for: " + fullPath + "; but found: " + ioFile.getCanonicalPath());
|
||||
}
|
||||
}
|
||||
|
||||
@NonNls
|
||||
@NotNull
|
||||
protected String getTestDataPath() {
|
||||
@@ -341,6 +350,7 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
|
||||
assertTrue(getMessage("Cannot find file " + fullPath, message), ioFile.exists());
|
||||
String fileText;
|
||||
try {
|
||||
checkCaseSensitiveFS(fullPath, ioFile);
|
||||
fileText = FileUtil.loadFile(ioFile, CharsetToolkit.UTF8_CHARSET);
|
||||
}
|
||||
catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user