代码拉取完成,页面将自动刷新
package tt
import "testing"
// Assertions provides assertion methods around the
// TestingT interface.
type Assertions struct {
t TestingT
}
// New makes a new Assertions object for the specified TestingT.
func New(t TestingT) *Assertions {
return &Assertions{
t: t,
}
}
// BM func Benchmark1(b *testing.B, fn func())
func (at *Assertions) BM(b *testing.B, fn func()) {
for i := 0; i < b.N; i++ {
fn()
}
}
// Equal asserts that two objects are equal.
func (at *Assertions) Equal(expect, actual interface{}, args ...int) bool {
call := 5
if len(args) > 0 {
call = args[0]
}
return Equal(at.t, expect, actual, call)
}
// Expect asserts that string and objects are equal.
func (at *Assertions) Expect(expect string, actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return Expect(at.t, expect, actual, call)
}
// Nil asserts that nil and objects are equal.
func (at *Assertions) Nil(actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return Expect(at.t, "<nil>", actual, call)
}
// Empty asserts that empty and objects are equal.
func (at *Assertions) Empty(actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return Expect(at.t, "", actual, call)
}
// Bool asserts that true and objects are equal.
func (at *Assertions) Bool(actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return Expect(at.t, "true", actual, call)
}
// True asserts that true and objects are equal.
func (at *Assertions) True(actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return Expect(at.t, "true", actual, call)
}
// False asserts that flase and objects are equal.
func (at *Assertions) False(actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return Expect(at.t, "false", actual, call)
}
// Not asserts that two objects are not equal.
func (at *Assertions) Not(expect, actual interface{}, args ...int) bool {
call := 5
if len(args) > 0 {
call = args[0]
}
return Not(at.t, expect, actual, call)
}
// NotEqual asserts that two objects are not equal.
func (at *Assertions) NotEqual(expect, actual interface{}, args ...int) bool {
call := 5
if len(args) > 0 {
call = args[0]
}
return NotEqual(at.t, expect, actual, call)
}
// NotExpect asserts that string and objects are not equal.
func (at *Assertions) NotExpect(expect string, actual interface{}, args ...int) bool {
call := 4
if len(args) > 0 {
call = args[0]
}
return NotExpect(at.t, expect, actual, call)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。