void (Object completionVariant, final String... baseFileNames) { final DocumentationTestContext context = new DocumentationTestContext(baseFileNames); String pathname = getTestDataPath() + baseFileNames[0] + ".expected.html"; VirtualFile vfile = LocalFileSystem.getInstance().findFileByIoFile(new File(pathname)); assertNotNull(pathname + " not found", vfile); try { String expectedText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(vfile)); String text = context.generateDoc(); assertThat(text).isNotNull(); assertEquals(stripFirstLine(expectedText).replaceAll("\\s+", ""), stripFirstLine(StringUtil.convertLineSeparators(text)).replaceAll("\\s+", "")); if (completionVariant != null) { vfile = LocalFileSystem.getInstance().findFileByIoFile(new File(getTestDataPath() + baseFileNames[0] + ".expected.completion.html")); expectedText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(vfile), "\n"); assertEquals(stripFirstLine(expectedText).replaceAll("\\s+", ""), stripFirstLine(StringUtil.convertLineSeparators(context.generateDocForCompletion(completionVariant), "\n")) .replaceAll("\\s+", "")); } } catch (IOException e) { throw new RuntimeException(e); } }