Skip to content

Commit 3d21f2f

Browse files
authored
Cleanup DartHighlightingTests and DartInjectionTests (#18)
All unit tests under com/jetbrains/lang/dart/* now pass.
1 parent 6423452 commit 3d21f2f

File tree

14 files changed

+0
-1074
lines changed

14 files changed

+0
-1074
lines changed

third_party/src/test/java/com/jetbrains/lang/dart/highlighting/DartHighlightingTest.java

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
22
package com.jetbrains.lang.dart.highlighting;
33

4-
import com.intellij.codeInsight.daemon.impl.analysis.HtmlUnknownTargetInspection;
5-
import com.intellij.codeInspection.htmlInspections.HtmlUnknownTagInspection;
64
import com.intellij.openapi.application.ApplicationManager;
75
import com.intellij.openapi.roots.ContentEntry;
86
import com.intellij.openapi.roots.ModifiableRootModel;
97
import com.intellij.openapi.roots.ModuleRootManager;
108
import com.intellij.psi.PsiFile;
119
import com.intellij.spellchecker.inspections.SpellCheckingInspection;
12-
import com.intellij.testFramework.ExpectedHighlightingData;
13-
import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
1410
import com.jetbrains.lang.dart.DartCodeInsightFixtureTestCase;
15-
import com.jetbrains.lang.dart.ide.inspections.DartPathPackageReferenceInspection;
1611
import com.jetbrains.lang.dart.util.DartResolveUtil;
1712

1813
import java.util.function.Consumer;
@@ -39,33 +34,6 @@ private void updateModuleRoots(Consumer<ContentEntry> contentEntryModifier) {
3934
});
4035
}
4136

42-
public void testScriptSrcPathToPackagesFolder() {
43-
final String testName = getTestName(false);
44-
myFixture.enableInspections(HtmlUnknownTargetInspection.class);
45-
46-
myFixture.addFileToProject("pubspec.yaml", """
47-
name: ProjectName
48-
dependencies:
49-
PathPackage:
50-
path: local_package
51-
""");
52-
myFixture.addFileToProject("lib/projectFile.dart", "");
53-
myFixture.addFileToProject("local_package/lib/localPackageFile.html", "");
54-
myFixture.addFileToProject("packages/browser/dart.js", "");
55-
myFixture.configureByFile(testName + "/" + testName + ".html");
56-
myFixture.checkHighlighting(true, false, true);
57-
}
58-
59-
public void testScriptSrcPathToDotPackagesFile() {
60-
myFixture.enableInspections(HtmlUnknownTargetInspection.class);
61-
myFixture.addFileToProject("pubspec.yaml", "name: ProjectName");
62-
myFixture.addFileToProject("local_package/lib/src/localPackageFile.html", "");
63-
myFixture.addFileToProject(".packages", "PathPackage:local_package/lib/");
64-
myFixture.configureByText("foo.html", "<link href=\"packages/PathPackage/src/localPackageFile.html\">\n" +
65-
"<link href=\"packages/PathPackage/src/<warning descr=\"Cannot resolve file 'incorrect.html'\">incorrect.html</warning> \">");
66-
myFixture.checkHighlighting(true, false, true);
67-
}
68-
6937
public void testSpelling() {
7038
myFixture.enableInspections(SpellCheckingInspection.class);
7139
myFixture.configureByFile(getTestName(false) + ".dart");
@@ -83,38 +51,6 @@ public void testColorAnnotatorIdePart() {
8351
myFixture.checkHighlighting(true, true, true);
8452
}
8553

86-
public void testSimplePolymer() {
87-
myFixture.enableInspections(HtmlUnknownTagInspection.class);
88-
myFixture.addFileToProject("pubspec.yaml", """
89-
name: ThisProject
90-
dependencies:
91-
PathPackage:
92-
path: PathPackage
93-
""");
94-
myFixture.addFileToProject("lib/custom_element.html", "<polymer-element name='custom-element'/>");
95-
myFixture.addFileToProject("PathPackage/lib/in_path_package.html", "<polymer-element name='path-package-element'/>");
96-
addStandardPackage("polymer");
97-
addStandardPackage("core_elements");
98-
myFixture.configureByFile(getTestName(false) + "/web/" + getTestName(false) + ".html");
99-
myFixture.checkHighlighting(true, false, true);
100-
}
101-
102-
public void testPathPackageReferenceInspection() {
103-
myFixture.enableInspections(new DartPathPackageReferenceInspection());
104-
myFixture.copyDirectoryToProject(getTestName(false), "");
105-
myFixture.openFileInEditor(ModuleRootManager.getInstance(getModule()).getContentRoots()[0].findChild("pubspec.yaml"));
106-
107-
ExpectedHighlightingData data = new ExpectedHighlightingData(myFixture.getEditor().getDocument(), true, true, false, false);
108-
data.init();
109-
((CodeInsightTestFixtureImpl)myFixture).collectAndCheckHighlighting(data);
110-
111-
updateModuleRoots((contentEntry) -> contentEntry.addExcludeFolder(contentEntry.getUrl() + "/other_project"));
112-
((CodeInsightTestFixtureImpl)myFixture).collectAndCheckHighlighting(data);
113-
114-
updateModuleRoots((contentEntry) -> contentEntry.addSourceFolder(contentEntry.getUrl() + "/test", true));
115-
((CodeInsightTestFixtureImpl)myFixture).collectAndCheckHighlighting(data);
116-
}
117-
11854
public void testUriInPartOf() {
11955
final PsiFile libFile = myFixture.addFileToProject("foo/bar/libFile.dart", "library libName;");
12056
final PsiFile part1File = myFixture.addFileToProject("part1.dart", "part of 'part1.dart'"); // self reference

third_party/src/test/java/com/jetbrains/lang/dart/injection/DartInjectionTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,4 @@ private String toParseTreeText(PsiFile file) {
3030
public void testHtmlInStrings() throws Exception {
3131
doTest();
3232
}
33-
34-
public void testRegExp() throws Exception {
35-
Assume.assumeTrue("This test is not applicable in current environment because JavaScript plugin is not available",
36-
Language.findLanguageByID("JSRegexp") != null);
37-
doTest();
38-
}
39-
40-
public void testJsonWithComment() throws Exception {
41-
doTest();
42-
}
4333
}

third_party/src/test/testData/highlighting/PathPackageReferenceInspection/other_project/lib/foo.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.

third_party/src/test/testData/highlighting/PathPackageReferenceInspection/other_project/pubspec.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

third_party/src/test/testData/highlighting/PathPackageReferenceInspection/other_project_2/lib/bar.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.

third_party/src/test/testData/highlighting/PathPackageReferenceInspection/other_project_2/pubspec.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

third_party/src/test/testData/highlighting/PathPackageReferenceInspection/pubspec.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

third_party/src/test/testData/highlighting/PathPackageReferenceInspection/test/placeholder.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.

third_party/src/test/testData/highlighting/ScriptSrcPathToPackagesFolder/ScriptSrcPathToPackagesFolder.html

Lines changed: 0 additions & 27 deletions
This file was deleted.

third_party/src/test/testData/highlighting/SimplePolymer/web/SimplePolymer.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)