void (@NotNull String expectedText, boolean stripTrailingSpaces) { IdeaTestExecutionPolicy policy = IdeaTestExecutionPolicy.current(); if (policy != null) { policy.beforeCheckResult(getFile()); } WriteCommandAction.runWriteCommandAction(getProject(), () -> { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); EditorUtil.fillVirtualSpaceUntilCaret(getHostEditor()); checkResult("TEXT", stripTrailingSpaces, SelectionAndCaretMarkupLoader.fromText(expectedText), getHostFile().getText()); }); }