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

Unified Diff: pkg/analysis_server/test/integration/coverage_test.dart

Issue 3000563002: Add analysis server notifications to the api coverage doc. (Closed)
Patch Set: Created 3 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/analysis_server/test/integration/coverage.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/integration/coverage_test.dart
diff --git a/pkg/analysis_server/test/integration/coverage_test.dart b/pkg/analysis_server/test/integration/coverage_test.dart
index 630813fa4d80fb70fef16b4f09c642da123aa025..b8b3c14e2376ce2a60ee20cc1bdd72724406576d 100644
--- a/pkg/analysis_server/test/integration/coverage_test.dart
+++ b/pkg/analysis_server/test/integration/coverage_test.dart
@@ -65,28 +65,56 @@ main() {
});
// requests
- for (Request request in domain.requests) {
- String fullName = '${domain.name}.${request.method}';
- test(fullName, () {
- if (!allMembers.contains(fullName)) {
- fail('$fullName not found in ${coverageFile.path}');
- }
-
- final String fileName = getCamelWords(request.method)
- .map((s) => s.toLowerCase())
- .join('_');
- final String testName =
- path.join(domain.name, '${fileName}_test.dart');
- final String testPath =
- path.join(pathPrefix, 'test', 'integration', testName);
-
- // Test that if checked, a test file exists; if not checked, no such
- // file exists.
- expect(FileSystemEntity.isFileSync(testPath),
- coveredMembers.contains(fullName),
- reason: '$testName state incorrect');
- });
- }
+ group('request', () {
+ for (Request request in domain.requests) {
+ String fullName = '${domain.name}.${request.method}';
+ test(fullName, () {
+ if (!allMembers.contains(fullName)) {
+ fail('$fullName not found in ${coverageFile.path}');
+ }
+
+ final String fileName = getCamelWords(request.method)
+ .map((s) => s.toLowerCase())
+ .join('_');
+ final String testName =
+ path.join(domain.name, '${fileName}_test.dart');
+ final String testPath =
+ path.join(pathPrefix, 'test', 'integration', testName);
+
+ // Test that if checked, a test file exists; if not checked, no such
+ // file exists.
+ expect(FileSystemEntity.isFileSync(testPath),
+ coveredMembers.contains(fullName),
+ reason: '$testName state incorrect');
+ });
+ }
+ });
+
+ // notifications
+ group('notification', () {
+ for (Notification notification in domain.notifications) {
+ String fullName = '${domain.name}.${notification.event}';
+ test(fullName, () {
+ if (!allMembers.contains(fullName)) {
+ fail('$fullName not found in ${coverageFile.path}');
+ }
+
+ final String fileName = getCamelWords(notification.event)
+ .map((s) => s.toLowerCase())
+ .join('_');
+ final String testName =
+ path.join(domain.name, '${fileName}_test.dart');
+ final String testPath =
+ path.join(pathPrefix, 'test', 'integration', testName);
+
+ // Test that if checked, a test file exists; if not checked, no such
+ // file exists.
+ expect(FileSystemEntity.isFileSync(testPath),
+ coveredMembers.contains(fullName),
+ reason: '$testName state incorrect');
+ });
+ }
+ });
});
}
« no previous file with comments | « pkg/analysis_server/test/integration/coverage.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698