void (boolean checkResult) { String name = getTestName(); try { String text = loadFile(name + "." + myFileExt); myFile = createPsiFile(name, text); ensureParsed(myFile); assertEquals("light virtual file text mismatch", text, ((LightVirtualFile)myFile.getVirtualFile()).getContent().toString()); assertEquals("virtual file text mismatch", text, LoadTextUtil.loadText(myFile.getVirtualFile())); assertEquals("doc text mismatch", text, myFile.getViewProvider().getDocument().getText()); assertEquals("psi text mismatch", text, myFile.getText()); ensureCorrectReparse(myFile); if (checkResult){ checkResult(name, myFile); } else{ toParseTreeText(myFile, skipSpaces(), includeRanges()); } } catch (IOException e) { throw new RuntimeException(e); } }