Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
7,000
void () { doTest(); }
testOnlyDocType
7,001
void () { myFixture.configureByFile(getTestName(false) + ".xhtml"); myFixture.checkHighlighting(true, false, false); }
testExternalValidationForXHtml
7,002
void () { doTest(); }
testAttributeValidationRelaxation
7,003
void () { doTest(); }
testIncompleteDoctype
7,004
void () { doTest(); }
testSOE
7,005
void () { if (HtmlToolsTestsUtil.isCommunityContext()) return; doTest("xhtml"); }
testSOEFromRelaxedDescriptor
7,006
void () { myFixture.disableInspections(new CheckXmlFileWithXercesValidatorInspection()); final String testName = getTestName(false); final String location = "XInclude.xsd"; final String url = "http://www.w3.org/2001/XInclude"; ExternalResourceManagerExImpl.registerResourceTemporarily(url, location, getTestRootDisposable()); myFixture.configureByFiles(testName + ".xhtml", location); myFixture.checkHighlighting(true, false, false); }
testXIncludeHRef
7,007
void () { myFixture.copyFileToProject(getTestName(false) + ".gif"); myFixture.copyFileToProject(getTestName(false) + ".svg"); myFixture.configureByFiles(getTestName(false) + ".html"); CheckImageSizeInspection tool = new CheckImageSizeInspection(); myFixture.enableInspections(tool); myFixture.checkHighlighting(true, false, false); myFixture.configureByFiles(getTestName(false) + "5.html"); myFixture.checkHighlighting(true, false, false); if (!HtmlToolsTestsUtil.isCommunityContext()) { myFixture.configureByFiles(getTestName(false) + ".jsp"); myFixture.checkHighlighting(true, false, false); } myFixture.configureByFiles(getTestName(false) + "DataUri.html"); myFixture.checkHighlighting(true, false, false); }
testCheckImageSizeInspection
7,008
void () { myFixture.configureByFile( getTestName(false) + ".xhtml" ); CheckValidXmlInScriptBodyInspection tool = new CheckValidXmlInScriptBodyInspection(); myFixture.enableInspections(tool); if (!HtmlToolsTestsUtil.isCommunityContext()) { myFixture.checkHighlighting(true, false, false); myFixture.configureByFile( getTestName(false) + "2.xhtml" ); myFixture.checkHighlighting(true, false, false); } myFixture.configureByFile( getTestName(false) + ".html" ); myFixture.checkHighlighting(true, false, false); myFixture.configureByFile( getTestName(false) + "2.html" ); myFixture.checkHighlighting(true, false, false); myFixture.configureByFile( getTestName(false) + "3.html" ); myFixture.checkHighlighting(true, false, false); }
testCheckValidXmlInScriptBodyInspection
7,009
void () { doTest(); }
testDifferentCaseInAttrs
7,010
void () { doTest(); }
testMapIdRequired
7,011
void () { doTest(); }
testUseMap
7,012
void () { doTest(); }
testSelectHasNoWidth
7,013
void () { doTest(); }
testRelativeProtocolUrls
7,014
void () { myFixture.enableInspections(new CheckEmptyTagInspection()); doTest(); }
testReportAboutEmptyEnd
7,015
void () { myFixture.configureByFile(getTestName(false) + ".xhtml"); myFixture.checkHighlighting(true, false, false); }
testXHtml11
7,016
void () { doTest(); myFixture.configureByFile(getTestName(false) + ".xhtml"); myFixture.checkHighlighting(true, false, false); myFixture.configureByFile(getTestName(false) + "2.xhtml"); myFixture.checkHighlighting(true, false, false); }
testEntities
7,017
void () { // 10 20 // 012345678901 2 345678901234567890 String text = "<xxx aaa = \"\"/> <xxx/>"; EditorHighlighter htmlHighlighter = HtmlHighlighterFactory.createHTMLHighlighter(EditorColorsManager.getInstance().getGlobalScheme()); htmlHighlighter.setText(text); HighlighterIterator iterator = htmlHighlighter.createIterator(4); assertEquals(XmlTokenType.TAG_WHITE_SPACE, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(8); assertEquals(XmlTokenType.TAG_WHITE_SPACE, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(10); assertEquals(XmlTokenType.TAG_WHITE_SPACE, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(15); assertEquals(XmlTokenType.XML_REAL_WHITE_SPACE, iterator.getTokenType()); // 10 20 // 01234567890123456 7890 1234567890 text = "<?xml version = \"1.0\"?> <html/>"; htmlHighlighter = HtmlHighlighterFactory.createHTMLHighlighter(EditorColorsManager.getInstance().getGlobalScheme()); htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(1); assertEquals(XmlTokenType.XML_PI_START, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(10); assertEquals(XmlTokenType.XML_PI_TARGET, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(22); assertEquals(XmlTokenType.XML_PI_END, iterator.getTokenType()); // 10 20 30 40 50 60 70 // 012345678 901234567890123456789012345678901234567890123456 789012 345 678 90 text = "<tr><td>\\${param.foo}</td><td>${param.foo}</td><td name=\"${el['el']}\"/></tr>"; htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(10); assertSame("Escaped el", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(30); assertSame("El start", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(35); assertSame("El identifier", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(37); assertSame("El dot", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(41); assertSame("El end", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(57); assertSame("El start", XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(61); assertSame("El lbracket", XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(63); assertSame("El string literal", XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(67); assertSame("El end", XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(68); assertSame("Attribute value end", XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER, iterator.getTokenType()); // 10 20 30 // 0123456789012345678901234567890123456 text = "<!--- bla --->"; htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(6); assertSame("Comment content", XmlTokenType.XML_COMMENT_CHARACTERS, iterator.getTokenType()); iterator = htmlHighlighter.createIterator(12); assertSame("Comment end", XmlTokenType.XML_COMMENT_END, iterator.getTokenType()); // 10 20 30 // 012345678901234 5 678901234567890123456 text = "<input onclick=\"\"/> <a></a>"; htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(19); assertEquals(XmlTokenType.XML_REAL_WHITE_SPACE, iterator.getTokenType()); // 10 20 30 // 0123456789012345678901234567890123456 text = "<#input tableRow as value></#input>"; htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(3); assertEquals(XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType()); // 10 // 01234567890123456789 text = "<!--&nbsp; &aaa;-->"; htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(5); assertEquals( "char entity in comment", XmlTokenType.XML_COMMENT_CHARACTERS, iterator.getTokenType() ); iterator = htmlHighlighter.createIterator(12); assertEquals( "entity ref in comment", XmlTokenType.XML_COMMENT_CHARACTERS, iterator.getTokenType() ); // 10 // 01234567890123456789 text = "<div> < in </div>"; htmlHighlighter.setText(text); iterator = htmlHighlighter.createIterator(6); assertEquals( "< before space should be tag data", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType() ); iterator = htmlHighlighter.createIterator(8); assertEquals( "should be tag data", XmlTokenType.XML_DATA_CHARACTERS, iterator.getTokenType() ); }
testEditorHighlighting
7,018
void () { myFixture.enableInspections(new HtmlDeprecatedTagInspection()); doTest(); }
testDeprecatedAndPresentationalTags
7,019
void () { myFixture.enableInspections(new HtmlDeprecatedAttributeInspection()); doTest(); }
testDeprecatedAttributes
7,020
void () { myFixture.enableInspections(new HtmlDeprecatedTagInspection()); doTest(); }
testDeprecatedAndPresentationalTagsHtml5
7,021
void () { myFixture.enableInspections(new HtmlDeprecatedTagInspection()); doTest(); }
testMenuHtml5TagNotDeprecated
7,022
void () { doTest(); }
testPresentationalTagInHtml5
7,023
void () { doTest("xhtml"); }
testPresentationalTagInXhtml5
7,024
void () { myFixture.configureByFile(getTestName(false) + ".html"); final XmlTag tag = PsiTreeUtil.getParentOfType(myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset()), XmlTag.class); assertNotNull(tag); assertNull(tag.getAttribute("type", "")); assertNotNull(tag.getAttribute("type", "http://tapestry.apache.org/schema/tapestry_5_0_0.xsd")); assertNotNull(tag.getAttribute("t:type", "")); assertNotNull(tag.getAttribute("type", "http://tapestry.apache.org/schema/tapestry_5_0_0.xsd")); }
testHtmlPsi
7,025
void () { myFixture.configureByFiles(getTestName(false) + ".html", getTestName(false) + ".css"); myFixture.checkHighlighting(true, false, false); }
testParametrizedReference
7,026
void () { doTestWithAddToCustomsQuickFix("Add zzz to custom html tags"); }
testAddCustomTagFixTest
7,027
void () { doTestWithAddToCustomsQuickFix("Add abba to custom html tags", 2); }
testAddCustomTagFixTest2
7,028
void () { doTestWithAddToCustomsQuickFix("Add zzz to custom html attributes"); }
testAddCustomAttributeFixTest
7,029
void () { doTestWithAddToCustomsQuickFix(XmlAnalysisBundle.message("html.quickfix.add.custom.html.boolean.attribute", "title")); }
testAddCustomBooleanAttribute
7,030
void () { doTestWithAddToCustomsQuickFix("Add alt to not required html attributes"); }
testAddNotRequiredAttributeFixTest
7,031
void () { myFixture.configureByFile(getTestName(false) + ".html"); myFixture.checkHighlighting(true, false, true); IntentionAction intention = myFixture.findSingleIntention(XmlPsiBundle.message("xml.quickfix.add.attribute.value.text")); myFixture.launchAction(intention); myFixture.checkResultByFile(getTestName(false) + "_after.html"); }
testUnknownBooleanAttributeWithAddAttributeValueQuickFix
7,032
void () { doTest(); }
testDataUri
7,033
void () { doTestHtml5QuickFixShouldBeFirst(); }
testHtml5QuickFixShouldBeFirst
7,034
void () { doTestHtml5QuickFixShouldBeFirst(); }
testHtml5QuickFixShouldBeFirst1
7,035
void () { doTest(); }
testPlaceChecking
7,036
void () { myFixture.enableInspections(new CheckDtdReferencesInspection()); doTest(); }
testHtml5Entities
7,037
void () { doTest(); }
testHtml5EmptyAttr
7,038
void () { doTest(); }
testHtml5Autocomplete
7,039
void () { // restore HTML5 doctype, because we're unable to determine it without doctype ExternalResourceManagerEx.getInstanceEx().setDefaultHtmlDoctype(myOldDoctype, getProject()); myFixture.enableInspections(new CheckDtdReferencesInspection()); doTest(); }
testHtml5EntitiesWithoutRootTag
7,040
void () { ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx(); String defaultHtmlDoctype = manager.getDefaultHtmlDoctype(getProject()); manager.setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), getProject()); try { doTest(); } finally { manager.setDefaultHtmlDoctype(defaultHtmlDoctype, getProject()); } }
testWI5823
7,041
void () { myFixture.enableInspections(new HtmlUnknownAttributeInspection()); doTest(); }
testWEB5171
7,042
void () { myFixture.enableInspections(new HtmlUnknownAttributeInspection()); doTest(); }
testWEB7422
7,043
void () { doTest(); }
testWEB404
7,044
void () { myFixture.enableInspections(new HtmlUnknownTagInspection()); doTest(); }
testWEB8397
7,045
void () { // if you see this test fail, please make sure that all attributes/elements containing nonW3C // in the declaration were removed from the schema // please update this test with all attributes/elements you remove this way myFixture.enableInspections(new HtmlDeprecatedTagInspection()); doTest(); }
testHtml5NonW3C
7,046
void () { doTest(); }
testImgLoading
7,047
void () { myFixture.enableInspections(new SpellCheckingInspection()); doTest(); }
testSpelling
7,048
void () { myFixture.copyFileToProject("CheckImageSizeInspection.gif", "images/CheckImageSizeInspection.gif"); myFixture.configureByFile("/Base.html"); myFixture.checkHighlighting(true, false, false); }
testBase
7,049
void () { doTest(); }
testBaseUrl
7,050
void () { HtmlUnknownTagInspection inspection = new HtmlUnknownTagInspection(); inspection.updateAdditionalEntries("custom-tag,custom2-TAG", getTestRootDisposable()); myFixture.enableInspections(inspection); HighlightTestInfo info = myFixture.testFile(getTestName(false) + ".html"); info.checkSymbolNames(); info.test(); }
testCustomTagHighlighting
7,051
void () { myFixture.configureByFile(getTestName(false) + ".html"); myFixture.doHighlighting(); ShowIntentionsPass.IntentionsInfo intentions = ShowIntentionsPass.getActionsToShow(myFixture.getEditor(), myFixture.getFile()); assertFalse(intentions.isEmpty()); CachedIntentions actions = CachedIntentions.createAndUpdateActions(getProject(), myFixture.getFile(), myFixture.getEditor(), intentions); assertNotEmpty(actions.getAllActions()); IntentionAction firstAction = actions.getAllActions().get(0).getAction(); assertEquals(new SwitchToHtml5WithHighPriorityAction().getText(), firstAction.getText()); }
doTestHtml5QuickFixShouldBeFirst
7,052
void (String intentionName) { doTestWithAddToCustomsQuickFix(intentionName, 1); }
doTestWithAddToCustomsQuickFix
7,053
void (String intentionName, final int fixesNum) { final String s = getTestName(false); myFixture.configureByFile(s + ".html"); Collection<HighlightInfo> highlightInfos = myFixture.doHighlighting(); assertEquals(fixesNum, highlightInfos.size()); IntentionAction intention = myFixture.findSingleIntention(intentionName); myFixture.launchAction(intention); assertEquals(0, myFixture.doHighlighting().stream().filter(el -> el.type != HighlightInfoType.INFORMATION).count()); }
doTestWithAddToCustomsQuickFix
7,054
void (String ext) { myFixture.configureByFile(getTestName(false) + "." + ext); myFixture.checkHighlighting(true, false, false); }
doTest
7,055
void () { doTest("html"); }
doTest
7,056
void () { doTest(getTestName(true), new XmlHighlightVisitorBasedInspection()); }
testReportingXmlHighlightVisitorProblems
7,057
String () { return PathManager.getCommunityHomePath() + "/plugins/htmltools/testData/inspections"; }
getTestDataPath
7,058
String () { return PathManager.getCommunityHomePath() + "/plugins/htmltools/testData/refactoring/move/"; }
getTestDataPath
7,059
void () { doTest("toDir", "B.html"); }
testHtml
7,060
void () { doTest(".markdown"); }
testMarkdownExtension
7,061
void () { doTest(".md"); }
testMdExtension
7,062
void (@NotNull String extension) { VirtualFile virtualFile = getTempDir().createVirtualFile(extension); PsiFile psi = getPsiManager().findFile(virtualFile); assertTrue(psi instanceof MarkdownFile); assertEquals(MarkdownFileType.INSTANCE, virtualFile.getFileType()); }
doTest
7,063
String () { return MarkdownTestingUtil.TEST_DATA_PATH + "/completion/languageList/"; }
getTestDataPath
7,064
void (@NotNull String toType) { myFixture.testCompletionTyping(getTestName(true) + ".md", toType, getTestName(true) + "_after.md"); }
doTest
7,065
void () { myFixture.configureByFile(getTestName(true) + ".md"); }
configure
7,066
void () { myFixture.checkResultByFile(getTestName(true) + "_after.md"); }
checkResult
7,067
void () { myFixture.testCompletionVariants(getTestName(true) + ".md"); }
checkEmptyCompletion
7,068
void () { doTest("jso\n"); }
testExistingFence
7,069
void () { configure(); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "json"); myFixture.type("so\t"); checkResult(); }
testExistingFenceTab
7,070
void () { checkEmptyCompletion(); }
testExistingNotFence
7,071
void () { doTest("jso\n"); }
testInSixQuotes
7,072
void () { checkEmptyCompletion(); }
testInSixQuotesNotMiddle
7,073
void () { configure(); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "json"); myFixture.type("so\t"); checkResult(); }
testInSixQuotesTab
7,074
void () { CodeFenceLanguageProvider.EP_NAME.getPoint().registerExtension(new CodeFenceLanguageProvider() { @Nullable @Override public Language getLanguageByInfoString(@NotNull String infoString) { return null; } @NotNull @Override public List<LookupElement> getCompletionVariantsForInfoString(@NotNull CompletionParameters parameters) { return Collections.singletonList(LookupElementBuilder.create("{json is a great lang}") .withInsertHandler((context, item) -> { context.getDocument().insertString(context.getEditor().getCaretModel().getOffset(), "Customized insertion"); context.getEditor().getCaretModel().moveCaretRelatively("Customized insertion".length(), 0, true, false, true); })); } }, myFixture.getTestRootDisposable()); configure(); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "json", "{json is a great lang}"); myFixture.type("g\t"); checkResult(); }
testCustomCompletionProvider
7,075
Language (@NotNull String infoString) { return null; }
getLanguageByInfoString
7,076
List<LookupElement> (@NotNull CompletionParameters parameters) { return Collections.singletonList(LookupElementBuilder.create("{json is a great lang}") .withInsertHandler((context, item) -> { context.getDocument().insertString(context.getEditor().getCaretModel().getOffset(), "Customized insertion"); context.getEditor().getCaretModel().moveCaretRelatively("Customized insertion".length(), 0, true, false, true); })); }
getCompletionVariantsForInfoString
7,077
void () { myFixture.configureByText(MarkdownFileType.INSTANCE, ""); type("```"); assertNotNull("Lookup should auto-activate", getLookup()); myFixture.checkResult("```<caret>```"); assertContainsElements(getLookup().getItems().stream().map(LookupElement::getLookupString).collect(Collectors.toList()), "json"); }
testAutopopup
7,078
String () { return MarkdownTestingUtil.TEST_DATA_PATH + "/html"; }
getTestDataPath
7,079
void (@NotNull String htmlText) { PsiFile mdFile = myFixture.configureByFile(getTestName(true) + ".md"); assertEquals(htmlText.trim(), MarkdownUtil.INSTANCE.generateMarkdownHtml(mdFile.getVirtualFile(), mdFile.getText(), getProject()).trim()); }
doTest
7,080
void () { doTestByHtmlFile(); }
testCodeFenceWithLang
7,081
void () { doTestByHtmlFile(); }
testCodeFenceWithoutLang
7,082
void () { doTestByHtmlFile(); }
testXmlTags
7,083
void () { doTestByHtmlFile(); }
testHtmlTags
7,084
void () { doTestByHtmlFile(); }
testComment
7,085
void () { doTestByHtmlFile(); }
testBackslashesInText
7,086
String () { return MarkdownTestingUtil.TEST_DATA_PATH + "/enter"; }
getTestDataPath
7,087
void () { doTest(); }
testQuote
7,088
void () { doTest(); }
testCodeFence
7,089
void () { doTest(); }
testCodeFenceLang
7,090
void () { doTest(); }
testCodeFenceMiddle
7,091
void () { doTest(); }
testQuoteInListMiddle
7,092
void () { doTest(); }
testQuoteInList
7,093
void () { doTest(); }
testQuoteInList1
7,094
void () { doTest(); }
testQuoteInListAfterFirstLine
7,095
void () { doTest(); }
testQuoteInListWithSpace
7,096
void () { doTest(); }
testCodeFenceWithSpace
7,097
void () { doTest(); }
testQuoteInListMiddleWithSpace
7,098
void () { String testName = getTestName(true); myFixture.configureByFile(testName + ".before.md"); myFixture.type("\n"); myFixture.checkResultByFile(testName + ".after.md"); }
doTest
7,099
void () { doTest(); }
testSimple