Skip to content
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

Test types.String #24

Merged
merged 5 commits into from
Jul 25, 2024
Merged

Test types.String #24

merged 5 commits into from
Jul 25, 2024

Conversation

Al2Klimov
Copy link
Member

No description provided.

@Al2Klimov Al2Klimov added the enhancement New feature or request label Jul 4, 2024
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Jul 4, 2024
@oxzi oxzi added the tests Adding tests to existing code label Jul 19, 2024
@Al2Klimov Al2Klimov removed the enhancement New feature or request label Jul 19, 2024

for _, st := range subtests {
t.Run(st.name, func(t *testing.T) {
require.Equal(t, String{NullString: sql.NullString{String: st.io, Valid: true}}, MakeString(st.io))
Copy link
Member

Choose a reason for hiding this comment

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

What's the benefit of this test function? It compares if a "manually" created String is equal to the exact same code being executed within the MakeString call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Test coverage 🤪

The most useful thing about this test case probably is that it checks that MakeString("") doesn't result in SQL NULL.

@julianbrost julianbrost merged commit 23a1e76 into main Jul 25, 2024
2 checks passed
@julianbrost julianbrost deleted the test-String branch July 25, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR tests Adding tests to existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants