mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
lazy: Reset error in Reset
To prevent sticky errors on server rebuilds. Fixes #7043 Closes #9194
This commit is contained in:
@@ -220,3 +220,22 @@ func TestInitBranchOrder(t *testing.T) {
|
||||
|
||||
c.Assert(state.V2, qt.Equals, "ABAB")
|
||||
}
|
||||
|
||||
// See issue 7043
|
||||
func TestResetError(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
r := false
|
||||
i := New().Add(func() (interface{}, error) {
|
||||
if r {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.New("r is false")
|
||||
})
|
||||
_, err := i.Do()
|
||||
c.Assert(err, qt.IsNotNil)
|
||||
i.Reset()
|
||||
r = true
|
||||
_, err = i.Do()
|
||||
c.Assert(err, qt.IsNil)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user