-
Notifications
You must be signed in to change notification settings - Fork 544
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
--bugfix="assert.NotNil not work" #1179
Conversation
In functions that don't work due to argument judgement
liziwei seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Describe the bug 使用 assert 的 NotNil 断言时不生效 Replay import "github.com/cloudwego/hertz/pkg/common/test/assert"
func TestAssertNotNil(t *testing.T) {
var test interface{}
assert.NotNil(t, test)
fmt.Println("test 值不为空")
} Hertz version:
bugfix func NotNil(t testing.TB, data interface{}) {
t.Helper()
if data != nil {
return
}
if reflect.ValueOf(data).IsNil() {
t.Fatalf("assertion failed, unexpected: %v, expected: not nil", data)
}
} |
有一些 ut 没过,可以瞅瞅 |
@welkeyever |
嗯,看起来是的,可以一并修复下对应的 ut |
@welkeyever |
可能需要统一下,可以本地 squash 成一个 commit |
我重新提交PR |
#1178
修复 assert的 NotNil 不生效。(参数判断有误)