-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Limit Dependencies to the stdlib #1971
Conversation
As much as I like stdlib and desest testing frameworks like testify, I'm not sure it's the right course of action here. |
How do you think we should approach this then? |
I don't know, honestly. I'll pass on reviewing this PR and just defer to other maintainers here. That said, thanks a lot for contributing to this project :) It's great! I'm just not versed well-enough in this codebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fan of perfectionism LOL
} | ||
|
||
// NotContains asserts that the specified string does NOT contain the specified substring. | ||
func NotContains(t *testing.T, s, contains string, msgAndArgs ...interface{}) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that grammar is important even for us developers 👨🏫
- func NotContains(t *testing.T, s, contains string, msgAndArgs ...interface{}) bool {
+ func DoesNotContain(t *testing.T, s, contains string, msgAndArgs ...interface{}) bool {
|
||
// RequireNotContains asserts that the specified string does NOT contain the specified substring. If it does, the test | ||
// will stop. | ||
func RequireNotContains(t *testing.T, s, contains string, msgAndArgs ...interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- func RequireNotContains(t *testing.T, s, contains string, msgAndArgs ...interface{}) {
+ func RequireDoesNotContain(t *testing.T, s, contains string, msgAndArgs ...interface{}) {
I know this might sound weird. But, I think we should have a test for those testing functions too using the standard library only. These tests would test that those testing functions are actually doing the job of testing (term for example: func TestThatNilActuallyWorks(t *testing.T){
if !Nil(nil){
t.Fail("Nil doesn't actually work, our tests are risky then.")
}
} |
You've forgot to include license. |
Do we really want to maintain a testing framework ourselves ? We have to add tests for the test framework itself now. Is testify required by the users of this library to run their code ? |
It's not, it doesn't appear in my app's go.mod and go.sum. |
Then what's the point of us struggling so much for this one library |
Yeah, I am with @dearchap here. Let's stay with testify. There are better issues to spend time on in this codebase:) |
Agreed |
What type of PR is this?
What this PR does / why we need it:
This PR removes the last remaining dependency
testify
. In line with the famous Go Proverb: A little copying is better than a little dependency. I have decided to copy over the necessary code to make our tests work.Which issue(s) this PR fixes:
Fixes #1890
Special notes for your reviewer:
(fill-in or delete this section)
Testing
(fill-in or delete this section)
Release Notes
(REQUIRED)