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

Unified Diff: pkg/dart_messages/test/dart_messages_test.dart

Issue 1770703002: Use error-names for 'specializationOf'. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/dart_messages/lib/shared_messages.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dart_messages/test/dart_messages_test.dart
diff --git a/pkg/dart_messages/test/dart_messages_test.dart b/pkg/dart_messages/test/dart_messages_test.dart
index b05bc3f18217c8470ef19ece53203c369362500a..80ecaaf00536526dbdd613d98183839175c5edab 100644
--- a/pkg/dart_messages/test/dart_messages_test.dart
+++ b/pkg/dart_messages/test/dart_messages_test.dart
@@ -33,7 +33,24 @@ void testIdsAreUnique() {
}
}
+void testSpecializationsAreOfSameId() {
+ for (var entry in MESSAGES.values) {
+ var specializationOf = entry.specializationOf;
+ if (specializationOf == null) continue;
+ var generic = MESSAGES[specializationOf];
+ if (generic == null) {
+ throw "More generic message doesn't exist: $specializationOf";
+ }
+ if (generic.id != entry.id) {
+ var id = "${entry.id}-${entry.subId}";
+ var genericId = "${generic.id}-${generic.subId}";
+ throw "Specialization doesn't have same id: $id - $genericId";
+ }
+ }
+}
+
void main() {
testJsonIsUpdated();
testIdsAreUnique();
+ testSpecializationsAreOfSameId();
}
« no previous file with comments | « pkg/dart_messages/lib/shared_messages.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698