You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type key string
func TestEmpty(t *testing.T) {
var k key = ""
assert.Empty(t, k, "confusing to fail")
assert.NotEmpty(t, k, "this is very error prone when used in tests")
}
The assert.Empty above fails. While I understand what is going on, it is confusing and very error prone in tests when one uses assert.NotEmpty instead.
The text was updated successfully, but these errors were encountered:
bits01
added a commit
to bits01/testify
that referenced
this issue
Jul 5, 2017
Consider the following example:
The
assert.Empty
above fails. While I understand what is going on, it is confusing and very error prone in tests when one usesassert.NotEmpty
instead.The text was updated successfully, but these errors were encountered: