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(); |
} |