@@ -283,7 +283,6 @@ func checkRustPackages(t *testing.T, got *codec, want *codec) {
283283
284284func TestWellKnownTypesExist (t * testing.T ) {
285285 model := api .NewTestAPI ([]* api.Message {}, []* api.Enum {}, []* api.Service {})
286- loadWellKnownTypes (model .State )
287286 for _ , name := range []string {"Any" , "Duration" , "Empty" , "FieldMask" , "Timestamp" } {
288287 if _ , ok := model .State .MessageByID [fmt .Sprintf (".google.protobuf.%s" , name )]; ! ok {
289288 t .Errorf ("cannot find well-known message %s in API" , name )
@@ -294,7 +293,6 @@ func TestWellKnownTypesExist(t *testing.T) {
294293func TestWellKnownTypesAsMethod (t * testing.T ) {
295294 model := api .NewTestAPI ([]* api.Message {}, []* api.Enum {}, []* api.Service {})
296295 c := createRustCodec ()
297- loadWellKnownTypes (model .State )
298296
299297 want := "wkt::Empty"
300298 got := c .methodInOutTypeName (".google.protobuf.Empty" , model .State , model .PackageName )
@@ -371,7 +369,6 @@ func TestMethodInOut(t *testing.T) {
371369 }
372370 model := api .NewTestAPI ([]* api.Message {message , nested }, []* api.Enum {}, []* api.Service {})
373371 c := createRustCodec ()
374- loadWellKnownTypes (model .State )
375372
376373 want := "crate::model::Target"
377374 got := c .methodInOutTypeName ("..Target" , model .State , model .PackageName )
@@ -534,7 +531,6 @@ func TestFieldType(t *testing.T) {
534531 "f_map" : "std::collections::HashMap<i32,i32>" ,
535532 }
536533 c := createRustCodec ()
537- loadWellKnownTypes (model .State )
538534 for _ , field := range message .Fields {
539535 want , ok := expectedTypes [field .Name ]
540536 if ! ok {
@@ -579,7 +575,6 @@ func TestOneOfFieldType(t *testing.T) {
579575 "f_map" : "std::collections::HashMap<i32,i32>" ,
580576 }
581577 c := createRustCodec ()
582- loadWellKnownTypes (model .State )
583578 for _ , field := range message .Fields {
584579 want , ok := expectedTypes [field .Name ]
585580 if ! ok {
@@ -655,7 +650,6 @@ func TestFieldMapTypeValues(t *testing.T) {
655650 model := api .NewTestAPI ([]* api.Message {message , other_message , map_thing }, []* api.Enum {}, []* api.Service {})
656651 api .LabelRecursiveFields (model )
657652 c := createRustCodec ()
658- loadWellKnownTypes (model .State )
659653 got := fieldType (field , model .State , false , c .modulePath , model .PackageName , c .packageMapping )
660654 if got != test .want {
661655 t .Errorf ("mismatched field type for %s, got=%s, want=%s" , field .Name , got , test .want )
@@ -716,7 +710,6 @@ func TestFieldMapTypeKey(t *testing.T) {
716710 model := api .NewTestAPI ([]* api.Message {message , map_thing }, []* api.Enum {enum }, []* api.Service {})
717711 api .LabelRecursiveFields (model )
718712 c := createRustCodec ()
719- loadWellKnownTypes (model .State )
720713 got := fieldType (field , model .State , false , c .modulePath , model .PackageName , c .packageMapping )
721714 if got != test .want {
722715 t .Errorf ("mismatched field type for %s, got=%s, want=%s" , field .Name , got , test .want )
@@ -725,16 +718,11 @@ func TestFieldMapTypeKey(t *testing.T) {
725718}
726719
727720func TestAsQueryParameter (t * testing.T ) {
728- options := & api.Message {
729- Name : "Options" ,
730- ID : "..Options" ,
731- Fields : []* api.Field {},
732- }
733721 optionsField := & api.Field {
734722 Name : "options_field" ,
735723 JSONName : "optionsField" ,
736724 Typez : api .MESSAGE_TYPE ,
737- TypezID : options . ID ,
725+ TypezID : "..Options" ,
738726 Optional : true ,
739727 }
740728 requiredField := & api.Field {
@@ -786,21 +774,6 @@ func TestAsQueryParameter(t *testing.T) {
786774 TypezID : ".google.protobuf.FieldMask" ,
787775 Optional : true ,
788776 }
789- request := & api.Message {
790- Name : "TestRequest" ,
791- ID : "..TestRequest" ,
792- Fields : []* api.Field {
793- optionsField ,
794- requiredField , optionalField , repeatedField ,
795- requiredEnumField , optionalEnumField , repeatedEnumField ,
796- requiredFieldMaskField , optionalFieldMaskField ,
797- },
798- }
799- model := api .NewTestAPI (
800- []* api.Message {options , request },
801- []* api.Enum {},
802- []* api.Service {})
803- loadWellKnownTypes (model .State )
804777
805778 for _ , test := range []struct {
806779 field * api.Field
@@ -901,7 +874,6 @@ func TestOneOfAsQueryParameter(t *testing.T) {
901874 []* api.Enum {},
902875 []* api.Service {})
903876 api .CrossReference (model )
904- loadWellKnownTypes (model .State )
905877
906878 for _ , test := range []struct {
907879 field * api.Field
@@ -1315,7 +1287,6 @@ func TestFormatDocCommentsCrossLinks(t *testing.T) {
13151287 // To test the mappings we need a fairly complex model.API instance. Create it
13161288 // in a separate function to make this more readable.
13171289 model := makeApiForRustFormatDocCommentsCrossLinks ()
1318- loadWellKnownTypes (model .State )
13191290
13201291 got := c .formatDocComments (input , "test-only-ID" , model .State , []string {"test.v1" })
13211292 if diff := cmp .Diff (want , got ); diff != "" {
@@ -1375,7 +1346,6 @@ func TestFormatDocCommentsRelativeCrossLinks(t *testing.T) {
13751346 // To test the mappings we need a fairly complex model.API instance. Create it
13761347 // in a separate function to make this more readable.
13771348 model := makeApiForRustFormatDocCommentsCrossLinks ()
1378- loadWellKnownTypes (model .State )
13791349
13801350 got := c .formatDocComments (input , "test-only-ID" , model .State , []string {"test.v1" })
13811351 if diff := cmp .Diff (want , got ); diff != "" {
@@ -1435,7 +1405,6 @@ implied enum value reference [SomeMessage.SomeEnum.ENUM_VALUE][]
14351405 // To test the mappings we need a fairly complex model.API instance. Create it
14361406 // in a separate function to make this more readable.
14371407 model := makeApiForRustFormatDocCommentsCrossLinks ()
1438- loadWellKnownTypes (model .State )
14391408
14401409 got := c .formatDocComments (input , "test-only-ID" , model .State , []string {"test.v1.Message" , "test.v1" })
14411410 if diff := cmp .Diff (want , got ); diff != "" {
@@ -1659,7 +1628,6 @@ Hyperlink: <a href="https://hyperlink.com">Content</a>`
16591628 // To test the mappings we need a fairly complex model.API instance. Create it
16601629 // in a separate function to make this more readable.
16611630 model := makeApiForRustFormatDocCommentsCrossLinks ()
1662- loadWellKnownTypes (model .State )
16631631
16641632 got := c .formatDocComments (input , "test-only-ID" , model .State , []string {})
16651633 if diff := cmp .Diff (want , got ); diff != "" {
0 commit comments