Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87d7dd91 authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Avoid SetErrorHandler mutating FixtureFactory"

parents 0805d4eb 52323b51
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -182,7 +182,8 @@ type FixtureFactory interface {
	// Create a Fixture.
	Fixture(t *testing.T, preparers ...FixturePreparer) Fixture

	// Set the error handler that will be used to check any errors reported by the test.
	// SetErrorHandler 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.
@@ -578,8 +579,10 @@ func (f *fixtureFactory) Fixture(t *testing.T, preparers ...FixturePreparer) Fix
}

func (f *fixtureFactory) SetErrorHandler(errorHandler FixtureErrorHandler) FixtureFactory {
	f.errorHandler = errorHandler
	return f
	newFactory := &fixtureFactory{}
	*newFactory = *f
	newFactory.errorHandler = errorHandler
	return newFactory
}

func (f *fixtureFactory) RunTest(t *testing.T, preparers ...FixturePreparer) *TestResult {