package
Version:
v0.30.7
Opens a new window with list of versions in this module.
Published: Sep 28, 2022
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 6
Opens a new window with list of known importers.
Documentation
¶
Package assert 提供了单元测试时的断言功能,减少一些模板代码
func Equal(t TestingT, expected interface{}, actual interface{}, msg ...string)
IsNotNil 比如有时我们需要对 error 类型不等于 nil 做断言,但是我们并不关心 error 的具体值是什么
type TestingT interface {
Errorf(format string, args ...interface{})
}
TestingT 单元测试中的 *testing.T 和 *testing.B 都满足该接口
Source Files
¶
Click to show internal directories.
Click to hide internal directories.