Index: mojom/mojom_parser/serialization/serialization_test.go |
diff --git a/mojom/mojom_parser/serialization/serialization_test.go b/mojom/mojom_parser/serialization/serialization_test.go |
index baf834c57399bd8eb6d3a3db5a7dd47f2a3affc9..56e42358956aaeb500ca2a8a9cfdc0a3eab550b7 100644 |
--- a/mojom/mojom_parser/serialization/serialization_test.go |
+++ b/mojom/mojom_parser/serialization/serialization_test.go |
@@ -1155,6 +1155,33 @@ func TestWithComputedData(t *testing.T) { |
test := singleFileTest{} |
//////////////////////////////////////////////////////////// |
+ // Test Case: Empty struct |
+ //////////////////////////////////////////////////////////// |
+ { |
+ contents := ` |
+ struct Foo{ |
+ };` |
+ |
+ test.addTestCase("", contents) |
+ |
+ test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TYPE_KEY:Foo"} |
+ |
+ test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{ |
+ DeclData: test.newDeclData("Foo", "Foo"), |
+ Fields: []mojom_types.StructField{}, |
+ VersionInfo: &[]mojom_types.StructVersion{ |
+ mojom_types.StructVersion{ |
+ VersionNumber: 0, |
+ NumFields: 0, |
+ NumBytes: 8, |
+ }, |
+ }, |
+ }} |
+ |
+ test.endTestCase() |
+ } |
+ |
+ //////////////////////////////////////////////////////////// |
// Test Case: Test struct field min versions: 1,2 |
//////////////////////////////////////////////////////////// |
{ |