Esempio n. 1
0
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
		})
}
Esempio n. 2
0
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
		})
}
Esempio n. 3
0
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
		})
}
Esempio n. 4
0
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
		})
}
Esempio n. 5
0
func (s *HelpersS) TestAssertEqualSucceeding(c *gocheck.C) {
	testHelperSuccess(c, "AssertEqual(10, 10)", nil, func() interface{} {
		c.AssertEqual(10, 10)
		return nil
	})
}