@@ -49,20 +49,14 @@ func TestInfo(t *testing.T) {
4949 if err != nil {
5050 t .Fatal (err )
5151 }
52- wantName := "compute"
53- wantTitle := "Compute Engine API"
54- wantDescription := "Creates and runs virtual machines on Google Cloud Platform. "
55- if got . Name != wantName {
56- t . Errorf ( "want = %q; got = %q" , wantName , got . Name )
52+ want := & api. API {
53+ Name : "compute" ,
54+ Title : "Compute Engine API" ,
55+ Description : "Creates and runs virtual machines on Google Cloud Platform. " ,
56+ Revision : "20250810" ,
5757 }
58- if got .Title != wantTitle {
59- t .Errorf ("want = %q; got = %q" , wantTitle , got .Title )
60- }
61- if diff := cmp .Diff (wantDescription , got .Description ); diff != "" {
62- t .Errorf ("mismatch (-want +got):\n %s" , diff )
63- }
64- if got .PackageName != "" {
65- t .Errorf ("expected empty package name" )
58+ if diff := cmp .Diff (want , got , cmpopts .IgnoreFields (api.API {}, "State" , "Services" , "Messages" , "Enums" )); diff != "" {
59+ t .Errorf ("mismatch (-want, +got):\n %s" , diff )
6660 }
6761}
6862
@@ -76,21 +70,19 @@ func TestServiceConfigOverridesInfo(t *testing.T) {
7670 if err != nil {
7771 t .Fatal (err )
7872 }
79- if got .Name != sc .Name {
80- t .Errorf ("want = %q; got = %q" , sc .Title , got .Title )
73+ want := & api.API {
74+ Name : sc .Name ,
75+ Title : sc .Title ,
76+ Description : sc .Documentation .Summary ,
77+ Revision : "20250810" ,
78+ PackageName : "google.cloud.secretmanager.v1" ,
8179 }
82- if got .Title != sc .Title {
83- t .Errorf ("want = %q; got = %q" , sc .Title , got .Title )
84- }
85- if diff := cmp .Diff (sc .Documentation .Summary , got .Description ); diff != "" {
86- t .Errorf ("mismatch (-want +got):\n %s" , diff )
80+ if diff := cmp .Diff (want , got , cmpopts .IgnoreFields (api.API {}, "State" , "Services" , "Messages" , "Enums" )); diff != "" {
81+ t .Errorf ("mismatch (-want, +got):\n %s" , diff )
8782 }
8883 if len (sc .Apis ) != 2 {
8984 t .Fatalf ("expected 2 APIs in service config" )
9085 }
91- if got .PackageName == "" {
92- t .Errorf ("got empty package name" )
93- }
9486 if ! strings .HasPrefix (sc .Apis [1 ].Name , got .PackageName ) {
9587 t .Errorf ("mismatched package name want = %q, got = %q" , sc .Apis [1 ].Name , got .PackageName )
9688 }
0 commit comments