Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: pkg/analyzer/test/src/task/html_test.dart

Issue 1320273003: Clean up and improve some of the task tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/html_test.dart
diff --git a/pkg/analyzer/test/src/task/html_test.dart b/pkg/analyzer/test/src/task/html_test.dart
index 89e49927f96a664e7fb817cc6bd61405d09318c2..ec78be15093b85ba9f5c8d3d6758114f67cf2c3e 100644
--- a/pkg/analyzer/test/src/task/html_test.dart
+++ b/pkg/analyzer/test/src/task/html_test.dart
@@ -21,6 +21,10 @@ main() {
runReflectiveTests(ParseHtmlTaskTest);
}
+isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>();
+isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>();
+isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>();
+
@reflectiveTest
class DartScriptsTaskTest extends AbstractContextTest {
test_buildInputs() {
@@ -72,8 +76,7 @@ class DartScriptsTaskTest extends AbstractContextTest {
<body>
</body>
</html>''');
- computeResult(target, REFERENCED_LIBRARIES);
- expect(task, new isInstanceOf<DartScriptsTask>());
+ computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
expect(outputs[DART_SCRIPTS], hasLength(1));
DartScript script = outputs[DART_SCRIPTS][0];
@@ -94,8 +97,7 @@ class DartScriptsTaskTest extends AbstractContextTest {
<body>
</body>
</html>''');
- computeResult(target, REFERENCED_LIBRARIES);
- expect(task, new isInstanceOf<DartScriptsTask>());
+ computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
expect(outputs[DART_SCRIPTS], hasLength(0));
}
@@ -112,8 +114,7 @@ class DartScriptsTaskTest extends AbstractContextTest {
<body>
</body>
</html>''');
- computeResult(target, REFERENCED_LIBRARIES);
- expect(task, new isInstanceOf<DartScriptsTask>());
+ computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
expect(outputs[DART_SCRIPTS], hasLength(0));
}
@@ -130,8 +131,7 @@ class DartScriptsTaskTest extends AbstractContextTest {
<body>
</body>
</html>''');
- computeResult(target, REFERENCED_LIBRARIES);
- expect(task, new isInstanceOf<DartScriptsTask>());
+ computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
expect(outputs[REFERENCED_LIBRARIES], hasLength(1));
expect(outputs[DART_SCRIPTS], hasLength(0));
}
@@ -150,8 +150,7 @@ class DartScriptsTaskTest extends AbstractContextTest {
</body>
</html>
''');
- computeResult(target, REFERENCED_LIBRARIES);
- expect(task, new isInstanceOf<DartScriptsTask>());
+ computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
expect(outputs[DART_SCRIPTS], hasLength(0));
}
@@ -168,8 +167,7 @@ class DartScriptsTaskTest extends AbstractContextTest {
<body>
</body>
</html>''');
- computeResult(target, REFERENCED_LIBRARIES);
- expect(task, new isInstanceOf<DartScriptsTask>());
+ computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
expect(outputs[REFERENCED_LIBRARIES], hasLength(1));
expect(outputs[DART_SCRIPTS], hasLength(0));
}
@@ -231,8 +229,7 @@ class HtmlErrorsTaskTest extends AbstractContextTest {
<body>Test</body>
</html>
''');
- computeResult(target, HTML_ERRORS);
- expect(task, new isInstanceOf<HtmlErrorsTask>());
+ computeResult(target, HTML_ERRORS, matcher: isHtmlErrorsTask);
expect(outputs[HTML_ERRORS], hasLength(1));
}
@@ -249,8 +246,7 @@ class HtmlErrorsTaskTest extends AbstractContextTest {
</body>
</html>
''');
- computeResult(target, HTML_ERRORS);
- expect(task, new isInstanceOf<HtmlErrorsTask>());
+ computeResult(target, HTML_ERRORS, matcher: isHtmlErrorsTask);
expect(outputs[HTML_ERRORS], hasLength(1));
}
@@ -268,8 +264,7 @@ class HtmlErrorsTaskTest extends AbstractContextTest {
</body>
</html>
''');
- computeResult(target, HTML_ERRORS);
- expect(task, new isInstanceOf<HtmlErrorsTask>());
+ computeResult(target, HTML_ERRORS, matcher: isHtmlErrorsTask);
expect(outputs[HTML_ERRORS], isEmpty);
}
}
@@ -325,7 +320,7 @@ class ParseHtmlTaskTest extends AbstractContextTest {
</html>
''');
computeResult(target, HTML_DOCUMENT);
- expect(task, new isInstanceOf<ParseHtmlTask>());
+ expect(task, isParseHtmlTask);
expect(outputs[HTML_DOCUMENT], isNotNull);
expect(outputs[HTML_DOCUMENT_ERRORS], isNotEmpty);
}
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698