void (@NotNull String expectedFile, @NotNull PsiFile originalFile, boolean stripTrailingSpaces) { IdeaTestExecutionPolicy policy = IdeaTestExecutionPolicy.current(); if (policy != null) { policy.beforeCheckResult(getFile()); } PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); if (!stripTrailingSpaces) { EditorUtil.fillVirtualSpaceUntilCaret(getHostEditor()); } String fileText = originalFile.getText(); String path = getTestDataPath() + "/" + expectedFile; String charset = Optional.ofNullable(originalFile.getVirtualFile()).map(f -> f.getCharset().name()).orElse(null); checkResult(expectedFile, stripTrailingSpaces, SelectionAndCaretMarkupLoader.fromFile(path, charset), fileText); }