Skip to content

Conversation

@vfrank66
Copy link
Contributor

No description provided.

Copy link
Contributor

@evan-gordon evan-gordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall really good stuff here! I left a few comments, mostly styling and cleanup. I'm happy to approve once the comments are addressed :)

return false, fmt.Errorf("internal error - expected a ValueSetValue instead got %v", reflect.ValueOf(vs.GolangValue()).Type())
}
// Handle different types of codes expressions
switch codesGolang := codesValue.GolangValue().(type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: IMO codesGolang isn't a good variable name, consider switching to cv here or something similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and done

})
}

func TestExpandValueSetEdgeCases(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically we stick to the golang table driven tests standard: https://go.dev/wiki/TableDrivenTests

for this case we could have something like:

tests := []struct {
  name:                     string
  valueSet:                string
  wantErrContains:  string
}{
  ...
}

would you mind making that change for this and other tests in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and done

// See the License for the specific language governing permissions and
// limitations under the License.

package terminology
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be terminology_test similar to how it is interminology/local_test.go

@@ -0,0 +1,480 @@
// Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a duplicate of terminology/expansion_test.go please remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and done

Copy link
Contributor

@evan-gordon evan-gordon Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were both terminology_expansion_test.go and expansion_test.go deleted? It looks like you mightve renamed it to terminology_test.go? I only asked that the package name get changed, not the file name as well :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you were asking me to makea a terminology_test like local_test.go? I was using this comment: #133 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion that's my mistake. I was specifically referring to the package name. The file name was fine :)

I'll try to be more explicit in the future for cases like this.

t.Run(tt.name, func(t *testing.T) {
codes, err := provider.ExpandValueSet(tt.valueSetURL, tt.version)

if tt.expectError {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all of these tests could you move the error case to it's own test func? I've found that test logic is a lot more readable and easy to maintaine when we do a different test grouping for error cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@copybara-service copybara-service bot merged commit 8a5a5fa into google:main Sep 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants