@@ -211,19 +211,21 @@ func TestTidy_DerivableFields(t *testing.T) {
211211 },
212212 }
213213 for _ , test := range []struct {
214- name string
215- config * config.Config
216- wantPath string
217- wantNumLibs int
218- wantNumChnls int
214+ name string
215+ config * config.Config
216+ wantPath string
217+ wantNumLibs int
218+ wantNumChnls int
219+ wantSpecificationFormat string
219220 }{
220221 {
221222 name : "derivable fields removed" ,
222223 config : & config.Config {
223224 Sources : googleapisSource ,
224225 Libraries : []* config.Library {
225226 {
226- Name : "google-cloud-accessapproval-v1" ,
227+ Name : "google-cloud-accessapproval-v1" ,
228+ SpecificationFormat : "protobuf" ,
227229 APIs : []* config.API {
228230 {
229231 Path : "google/cloud/accessapproval/v1" ,
@@ -232,9 +234,10 @@ func TestTidy_DerivableFields(t *testing.T) {
232234 },
233235 },
234236 },
235- wantPath : "" ,
236- wantNumLibs : 1 ,
237- wantNumChnls : 0 ,
237+ wantPath : "" ,
238+ wantNumLibs : 1 ,
239+ wantNumChnls : 0 ,
240+ wantSpecificationFormat : "" ,
238241 },
239242 {
240243 name : "non-derivable path not removed" ,
@@ -299,6 +302,9 @@ func TestTidy_DerivableFields(t *testing.T) {
299302 t .Errorf ("path should be %s, got %q" , test .wantPath , ch .Path )
300303 }
301304 }
305+ if lib .SpecificationFormat != test .wantSpecificationFormat {
306+ t .Errorf ("specification_format = %q, want %q" , lib .SpecificationFormat , test .wantSpecificationFormat )
307+ }
302308 })
303309 }
304310}
0 commit comments