void (@NotNull String verificationFileName, @Nullable String destinationFileName, boolean doCheckCollapseStatus) { String expectedContent; File verificationFile; try { verificationFile = new File(verificationFileName); expectedContent = FileUtil.loadFile(verificationFile); } catch (IOException e) { throw new RuntimeException(e); } assertNotNull(expectedContent); expectedContent = StringUtil.replace(expectedContent, "\r", ""); String cleanContent = removeFoldingMarkers(expectedContent); if (destinationFileName == null) { String fileName = PathUtil.getFileName(verificationFileName); configureByText(fileName, cleanContent); } else { try { @SuppressWarnings("ConstantConditions") String tempDirPrefix = myTempDirFixture.getFile("").getUrl(); // if destination (as a URL) points to a file inside the temp dir, then create it there if (destinationFileName.startsWith(tempDirPrefix)) { VirtualFile file = myTempDirFixture.createFile(destinationFileName.substring(tempDirPrefix.length()), cleanContent); assertNotNull(file); configureFromExistingVirtualFile(file); } else { FileUtil.writeToFile(new File(destinationFileName), cleanContent); VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(destinationFileName); assertNotNull(file); configureFromExistingVirtualFile(file); } } catch (IOException e) { throw new RuntimeException(e); } } String actual = getFoldingDescription(doCheckCollapseStatus); if (!expectedContent.equals(actual)) { throw new FileComparisonFailure(verificationFile.getName(), expectedContent, actual, verificationFile.getPath()); } }