Skip to content

add unit tests for go type gen function #1423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

sonasingh46
Copy link
Contributor

This PR adds unit test for GoTypeDef() method.

Signed-off-by: Ashutosh Kumar <ashutosh.kumar@elastic.co>
ReadOnly: tt.fields.ReadOnly,
WriteOnly: tt.fields.WriteOnly,
}
assert.Equalf(t, tt.want, p.GoTypeDef(), "GoTypeDef()")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert.Equalf(t, tt.want, p.GoTypeDef(), "GoTypeDef()")
assert.Equal(t, tt.want, p.GoTypeDef())

want: "*int",
},
{
name: "When field is readOnly and optional and and read only pointer disabled",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: "When field is readOnly and optional and and read only pointer disabled",
name: "When field is readOnly and optional and read only pointer disabled",

Signed-off-by: Ashutosh Kumar <ashutosh.kumar@elastic.co>
@jamietanna
Copy link
Member

Couple of things to address, then LGTM

@jamietanna jamietanna merged commit 887a24f into oapi-codegen:master Jan 10, 2024
@jamietanna jamietanna added the chore Any maintenance tasks that are regular, not as important to call out in the changelog label Jan 25, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
As part of follow-up changes we're making changes to `GoTypeDef`, so
it's handy to have some confidence that the existing behaviour isn't
affected by the changes.

Co-authored-by: Ashutosh Kumar <ashutosh.kumar@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Any maintenance tasks that are regular, not as important to call out in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants