本文整理汇总了Golang中gocheck.C.AssertEqual方法的典型用法代码示例。如果您正苦于以下问题:Golang C.AssertEqual方法的具体用法?Golang C.AssertEqual怎么用?Golang C.AssertEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gocheck.C
的用法示例。
在下文中一共展示了C.AssertEqual方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestAssertEqualArraySucceeding
func (s *HelpersS) TestAssertEqualArraySucceeding(c *gocheck.C) {
testHelperSuccess(c, "AssertEqual([]byte, []byte)", nil,
func() interface{} {
c.AssertEqual([]byte{1, 2}, []byte{1, 2})
return nil
})
}
示例2: TestAssertEqualArrayFailing
func (s *HelpersS) TestAssertEqualArrayFailing(c *gocheck.C) {
log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
"\\.+ AssertEqual\\(obtained, expected\\):\n" +
"\\.+ Obtained \\(\\[\\]uint8\\): \\[\\]byte{0x1, 0x2}\n" +
"\\.+ Expected \\(\\[\\]uint8\\): \\[\\]byte{0x1, 0x3}\n\n"
testHelperFailure(c, "AssertEqual([]byte{2}, []byte{3})", nil, true, log,
func() interface{} {
c.AssertEqual([]byte{1, 2}, []byte{1, 3})
return nil
})
}
示例3: TestAssertEqualFailing
func (s *HelpersS) TestAssertEqualFailing(c *gocheck.C) {
log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
"\\.+ AssertEqual\\(obtained, expected\\):\n" +
"\\.+ Obtained \\(int\\): 10\n" +
"\\.+ Expected \\(int\\): 20\n\n"
testHelperFailure(c, "AssertEqual(10, 20)", nil, true, log,
func() interface{} {
c.AssertEqual(10, 20)
return nil
})
}
示例4: TestAssertEqualWithMessage
func (s *HelpersS) TestAssertEqualWithMessage(c *gocheck.C) {
log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
"\\.+ AssertEqual\\(obtained, expected\\):\n" +
"\\.+ Obtained \\(int\\): 10\n" +
"\\.+ Expected \\(int\\): 20\n" +
"\\.+ That's clearly WRONG!\n\n"
testHelperFailure(c, "AssertEqual(10, 20, issue)", nil, true, log,
func() interface{} {
c.AssertEqual(10, 20, "That's clearly ", "WRONG!")
return nil
})
}
示例5: TestAssertEqualSucceeding
func (s *HelpersS) TestAssertEqualSucceeding(c *gocheck.C) {
testHelperSuccess(c, "AssertEqual(10, 10)", nil, func() interface{} {
c.AssertEqual(10, 10)
return nil
})
}