X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/80e348724041a694002fc38f57e8868b9b9a2be9..e86df5fad9aa2f280aad845adeefd239b0e944ae:/syncer_test.go?ds=inline diff --git a/syncer_test.go b/syncer_test.go index d463eec..8eeb1ee 100644 --- a/syncer_test.go +++ b/syncer_test.go @@ -76,16 +76,17 @@ func TestFlushWithoutWritesNeedsNoSync(t *testing.T) { } func TestAFailedSyncFailsEachLaterFlush(t *testing.T) { + failure := errors.New("disk error") s := newSyncer(func() error { - return errors.New("disk error") + return failure }) s.Written() - require.ErrorContains(t, s.Flush(t.Context()), "disk error") + require.ErrorIs(t, s.Flush(t.Context()), failure) s.Written() - require.ErrorContains(t, s.Flush(t.Context()), "disk error") - require.ErrorContains(t, s.Close(), "disk error") + require.ErrorIs(t, s.Flush(t.Context()), failure) + require.ErrorIs(t, s.Close(), failure) } func TestMemoryFlushSyncsTheChat(t *testing.T) {