Пример #1
0
func (s *HelpersS) TestAssertNotEqualArraySucceeding(c *gocheck.C) {
	testHelperSuccess(c, "AssertNotEqual([]byte, []byte)", nil,
		func() interface{} {
			c.AssertNotEqual([]byte{1, 2}, []byte{1, 3})
			return nil
		})
}
Пример #2
0
func (s *HelpersS) TestAssertNotEqualArrayFailing(c *gocheck.C) {
	log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
		"\\.+ AssertNotEqual\\(obtained, unexpected\\):\n" +
		"\\.+ Both \\(\\[\\]uint8\\): \\[\\]byte{0x1, 0x2}\n\n"
	testHelperFailure(c, "AssertNotEqual([]byte{2}, []byte{3})", nil, true,
		log, func() interface{} {
			c.AssertNotEqual([]byte{1, 2}, []byte{1, 2})
			return nil
		})
}
Пример #3
0
func (s *HelpersS) TestAssertNotEqualFailing(c *gocheck.C) {
	log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
		"\\.+ AssertNotEqual\\(obtained, unexpected\\):\n" +
		"\\.+ Both \\(int\\): 10\n\n"
	testHelperFailure(c, "AssertNotEqual(10, 10)", nil, true, log,
		func() interface{} {
			c.AssertNotEqual(10, 10)
			return nil
		})
}
Пример #4
0
func (s *HelpersS) TestAssertNotEqualWithMessage(c *gocheck.C) {
	log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
		"\\.+ AssertNotEqual\\(obtained, unexpected\\):\n" +
		"\\.+ Both \\(int\\): 10\n" +
		"\\.+ That's clearly WRONG!\n\n"
	testHelperFailure(c, "AssertNotEqual(10, 10, issue)", nil, true, log,
		func() interface{} {
			c.AssertNotEqual(10, 10, "That's clearly ", "WRONG!")
			return nil
		})
}
Пример #5
0
func (s *HelpersS) TestAssertNotEqualSucceeding(c *gocheck.C) {
	testHelperSuccess(c, "AssertNotEqual(10, 20)", nil, func() interface{} {
		c.AssertNotEqual(10, 20)
		return nil
	})
}