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

testing framework #18

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

WillMatthews
Copy link
Contributor

@WillMatthews WillMatthews commented Sep 1, 2024

This is a bit of an opinionated change (feel free to completely reject), but I think using testify may help with test quality (in terms of readability, DRY, lines of code).

A drawback and potential reason for rejection is that this PR adds a dependency.

This PR does the following:

  • Makes all tests use testify's require
  • Fixes a few comments, and removes a few unnecessary ones
  • Makes the testing helper function toPtr a generic

@liushuangls
Copy link
Owner

I prefer to keep dependencies to a minimum, so perhaps we can add some helper functions to the checks package to optimize the test code.

@WillMatthews
Copy link
Contributor Author

sounds sensible to me! We only use a tiny part of the require package, so I think using "a little copying is better than a little dependency" is a fair Go Proverb to rest on here. (I'll have a try at this over the next few days).

@WillMatthews WillMatthews marked this pull request as draft September 5, 2024 09:55
@WillMatthews WillMatthews changed the title testify for go tests testing framework Sep 5, 2024
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