예제 #1
0
파일: helpers_test.go 프로젝트: nuin/ampify
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
0
파일: helpers_test.go 프로젝트: nuin/ampify
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
0
파일: helpers_test.go 프로젝트: nuin/ampify
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
0
파일: helpers_test.go 프로젝트: nuin/ampify
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
0
파일: helpers_test.go 프로젝트: nuin/ampify
func (s *HelpersS) TestAssertEqualSucceeding(c *gocheck.C) {
	testHelperSuccess(c, "AssertEqual(10, 10)", nil, func() interface{} {
		c.AssertEqual(10, 10)
		return nil
	})
}