Merge "Rename SetErrorHandler to ExtendWithErrorHandler" am: 282671d696 am: ef8f637b5a

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1623768

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I19e659d14f891f0e98d45aca899f9bed7b349cac
This commit is contained in:
Paul Duffin 2021-03-10 13:25:28 +00:00 committed by Automerger Merge Worker
commit deb61e6e1e
2 changed files with 5 additions and 5 deletions

View File

@ -183,12 +183,12 @@ type FixtureFactory interface {
// Create a Fixture.
Fixture(t *testing.T, preparers ...FixturePreparer) Fixture
// SetErrorHandler creates a new FixtureFactory that will use the supplied error handler to check
// the errors (may be 0) reported by the test.
// ExtendWithErrorHandler creates a new FixtureFactory that will use the supplied error handler
// to check the errors (may be 0) reported by the test.
//
// The default handlers is FixtureExpectsNoErrors which will fail the go test immediately if any
// errors are reported.
SetErrorHandler(errorHandler FixtureErrorHandler) FixtureFactory
ExtendWithErrorHandler(errorHandler FixtureErrorHandler) FixtureFactory
// Run the test, checking any errors reported and returning a TestResult instance.
//
@ -640,7 +640,7 @@ func (f *fixtureFactory) Fixture(t *testing.T, preparers ...FixturePreparer) Fix
return fixture
}
func (f *fixtureFactory) SetErrorHandler(errorHandler FixtureErrorHandler) FixtureFactory {
func (f *fixtureFactory) ExtendWithErrorHandler(errorHandler FixtureErrorHandler) FixtureFactory {
newFactory := &fixtureFactory{}
*newFactory = *f
newFactory.errorHandler = errorHandler

View File

@ -1162,7 +1162,7 @@ func TestVisibility(t *testing.T) {
// Add additional files to the mock filesystem
test.fs.AddToFixture(),
).
SetErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)).
ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)).
RunTest(t)
if test.effectiveVisibility != nil {