Skip to content

Commit

Permalink
fix regression in test failing when not updating
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
emidoots committed Dec 21, 2022
1 parent 4f13276 commit f310030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autogold.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func ExpectFile(t *testing.T, got interface{}, opts ...Option) {
t.Fatal(err)
}
}
if *failOnUpdate {
if *failOnUpdate || !*update {
t.Log(fmt.Errorf("mismatch (-want +got):\n%s", colorDiff(diff)))
t.FailNow()
}
Expand Down
2 changes: 1 addition & 1 deletion expect.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func Expect(want interface{}) Value {
t.Fatal(err)
}
}
if *failOnUpdate {
if *failOnUpdate || !*update {
writeProfile()
t.Log(fmt.Errorf("mismatch (-want +got):\n%s", colorDiff(diff)))
t.FailNow()
Expand Down

0 comments on commit f310030

Please sign in to comment.