Example #1
0
func (s *HelpersS) TestAssertMatchFailingWithPureStrMatch(c *gocheck.C) {
	log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
		"\\.+ AssertMatch\\(value, expression\\):\n" +
		"\\.+ Value \\(string\\): \"foobar\"\n" +
		"\\.+ Expected to match expression: \"foobaz\"\n\n"
	testHelperFailure(c, "AssertMatch('foobar', 'foobaz')", nil, true, log,
		func() interface{} {
			c.AssertMatch("foobar", "foobaz")
			return nil
		})
}
Example #2
0
func (s *HelpersS) TestAssertMatchFailing(c *gocheck.C) {
	log := "helpers_test.go:[0-9]+ > helpers_test.go:[0-9]+:\n" +
		"\\.+ AssertMatch\\(value, expression\\):\n" +
		"\\.+ Value \\(os\\.Errno\\): 13 \\(permission denied\\)\n" +
		"\\.+ Expected to match expression: \"foo\"\n\n"
	testHelperFailure(c, "AssertMatch(error, foo)", nil, true, log,
		func() interface{} {
			c.AssertMatch(os.Errno(13), "foo")
			return nil
		})
}
Example #3
0
func (s *HelpersS) TestAssertMatchSucceedingWithError(c *gocheck.C) {
	testHelperSuccess(c, "AssertMatch(os.Error, exp)", nil, func() interface{} {
		c.AssertMatch(os.Errno(13), "perm.*denied")
		return nil
	})
}
Example #4
0
func (s *HelpersS) TestAssertMatchSucceeding(c *gocheck.C) {
	testHelperSuccess(c, "AssertMatch(s, exp)", nil, func() interface{} {
		c.AssertMatch("str error", "str.*r")
		return nil
	})
}