blinking test fixed

This commit is contained in:
Dmitry Avdeev
2016-03-04 16:29:32 +03:00
parent bbde6e9121
commit 95859d46eb
@@ -96,15 +96,21 @@ public class XmlDocumentationTest extends LightPlatformCodeInsightFixtureTestCas
String expectedText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(vfile));
String text = context.generateDoc();
assertNotNull(text);
assertEquals(expectedText, StringUtil.convertLineSeparators(text));
assertEquals(stripFirstLine(expectedText), stripFirstLine(StringUtil.convertLineSeparators(text)));
if (completionVariant != null) {
vfile = LocalFileSystem.getInstance().findFileByIoFile(new File(getTestDataPath() +baseFileNames[0] + ".expected.completion.html"));
expectedText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(vfile), "\n");
assertEquals(expectedText, StringUtil.convertLineSeparators(context.generateDocForCompletion(completionVariant), "\n"));
assertEquals(stripFirstLine(expectedText), stripFirstLine(StringUtil.convertLineSeparators(context.generateDocForCompletion(completionVariant), "\n")));
}
}
// the first line may contain attributes in unpredictable order (after Transform work)
private static String stripFirstLine(String text) {
if (!text.startsWith("<html ")) return text;
return text.substring(text.indexOf('\n'));
}
public void testDtdDoc() throws Exception {
doOneTest("dtd.dtd", "foo", false, true, "web-app_2_4.xsd");
doOneTest("dtd.xml", "foo", false, true, "web-app_2_4.xsd");