Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions internal/librarian/php/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestGatherProtos(t *testing.T) {
}

func TestGapicOpts(t *testing.T) {
tests := []struct {
for _, test := range []struct {
Comment thread
zhumin8 marked this conversation as resolved.
name string
api *config.API
apiMetadata *serviceconfig.API
Expand Down Expand Up @@ -143,7 +143,8 @@ func TestGapicOpts(t *testing.T) {
},
grpcConfigPath: "grpc_config.json",
want: []string{
"metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY", "rest-numeric-enums", "generate-snippets",
"metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY",
"rest-numeric-enums", "generate-snippets",
"grpc_service_config=grpc_config.json",
"service_yaml=service.yaml",
},
Expand All @@ -154,7 +155,8 @@ func TestGapicOpts(t *testing.T) {
apiMetadata: &serviceconfig.API{
SkipRESTNumericEnums: []string{"php"},
},
want: []string{"metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY", "generate-snippets"},
want: []string{"metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY",
"generate-snippets"},
},
{
name: "custom transport",
Expand All @@ -164,10 +166,10 @@ func TestGapicOpts(t *testing.T) {
"php": serviceconfig.Transport("rest"),
},
},
want: []string{"metadata", "transport=rest", "migration-mode=NEW_SURFACE_ONLY", "rest-numeric-enums", "generate-snippets"},
want: []string{"metadata", "transport=rest", "migration-mode=NEW_SURFACE_ONLY",
"rest-numeric-enums", "generate-snippets"},
},
}
for _, test := range tests {
} {
t.Run(test.name, func(t *testing.T) {
got := gapicOpts(test.api, test.apiMetadata, test.grpcConfigPath)
if diff := cmp.Diff(test.want, got); diff != "" {
Expand Down
Loading