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

Side by Side Diff: mojom/mojom_parser/parser/computed_data_test.go

Issue 1819223002: Mojom frontend: Allow non-reference types in non-zero versions of a struct. (Closed) Base URL: https://github.com/domokit/mojo.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package parser 5 package parser
6 6
7 import ( 7 import (
8 "mojom/mojom_parser/mojom" 8 "mojom/mojom_parser/mojom"
9 "strings" 9 "strings"
10 "testing" 10 "testing"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 int32 y; 149 int32 y;
150 150
151 [MinVersion = 1] 151 [MinVersion = 1]
152 array<int32> z; 152 array<int32> z;
153 153
154 [MinVersion = 2] 154 [MinVersion = 2]
155 array<int32>? w; 155 array<int32>? w;
156 };` 156 };`
157 test.addTestCase(contents, []string{ 157 test.addTestCase(contents, []string{
158 "Invalid type for field z: array<int32>.", 158 "Invalid type for field z: array<int32>.",
159 » » » "Non-nullable fields are only allowed in version 0 of of a struct.", 159 » » » "Non-nullable reference fields are only allowed in versi on 0 of of a struct.",
160 "This field's MinVersion is 1."}) 160 "This field's MinVersion is 1."})
161 } 161 }
162 162
163 //////////////////////////////////////////////////////////// 163 ////////////////////////////////////////////////////////////
164 // Execute all of the test cases. 164 // Execute all of the test cases.
165 //////////////////////////////////////////////////////////// 165 ////////////////////////////////////////////////////////////
166 for i, c := range test.cases { 166 for i, c := range test.cases {
167 // Parse anresolve the mojom input. 167 // Parse anresolve the mojom input.
168 descriptor := mojom.NewMojomDescriptor() 168 descriptor := mojom.NewMojomDescriptor()
169 specifiedName := "" 169 specifiedName := ""
(...skipping 21 matching lines...) Expand all
191 191
192 got := err.Error() 192 got := err.Error()
193 for _, expected := range c.expectedErrors { 193 for _, expected := range c.expectedErrors {
194 if !strings.Contains(got, expected) { 194 if !strings.Contains(got, expected) {
195 t.Errorf("%s:\n*****expected to contain:\n%s\n** **actual\n%s", c.fileName, expected, got) 195 t.Errorf("%s:\n*****expected to contain:\n%s\n** **actual\n%s", c.fileName, expected, got)
196 } 196 }
197 } 197 }
198 198
199 } 199 }
200 } 200 }
OLDNEW
« no previous file with comments | « mojom/mojom_parser/mojom/user_defined_types.go ('k') | mojom/mojom_parser/serialization/serialization_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698