Switch the namespace tests to fully use test fixtures
Indented the bp contents to make it easier to differentiate between them and the directory in which they belong. Bug: 181070625 Test: m nothing Change-Id: Iae7495fb7c88769dc688006a41f4d21f57cf03b8
This commit is contained in:
parent
61c6eef064
commit
0fc6d32c82
2 changed files with 443 additions and 469 deletions
|
@ -586,6 +586,18 @@ func FixtureExpectsAllErrorsToMatchAPattern(patterns []string) FixtureErrorHandl
|
|||
})
|
||||
}
|
||||
|
||||
// FixtureExpectsOneErrorPattern returns an error handler that will cause the test to fail
|
||||
// if there is more than one error or the error does not match the pattern.
|
||||
//
|
||||
// If the test fails this handler will call `result.FailNow()` which will exit the goroutine within
|
||||
// which the test is being run which means that the RunTest() method will not return.
|
||||
func FixtureExpectsOneErrorPattern(pattern string) FixtureErrorHandler {
|
||||
return FixtureCustomErrorHandler(func(t *testing.T, result *TestResult) {
|
||||
t.Helper()
|
||||
CheckErrorsAgainstExpectations(t, result.Errs, []string{pattern})
|
||||
})
|
||||
}
|
||||
|
||||
// FixtureCustomErrorHandler creates a custom error handler
|
||||
func FixtureCustomErrorHandler(function func(t *testing.T, result *TestResult)) FixtureErrorHandler {
|
||||
return simpleErrorHandler{
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue