From 71cdbbabd00bc748e9081798188f4e48f3dd2052 Mon Sep 17 00:00:00 2001 From: Al Cutter Date: Thu, 5 Dec 2024 17:33:14 +0000 Subject: [PATCH] Fix test to resolve futures --- dedupe_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dedupe_test.go b/dedupe_test.go index 8bc2aa1d..c29b0851 100644 --- a/dedupe_test.go +++ b/dedupe_test.go @@ -60,13 +60,15 @@ func TestDedupe(t *testing.T) { dedupeAdd := tessera.InMemoryDedupe(delegate, 256) // Add foo, bar, baz to prime the cache to make things interesting - dedupeAdd(ctx, tessera.NewEntry([]byte("foo"))) - dedupeAdd(ctx, tessera.NewEntry([]byte("bar"))) - dedupeAdd(ctx, tessera.NewEntry([]byte("baz"))) + for _, s := range []string{"foo", "bar", "baz"} { + if _, err := dedupeAdd(ctx, tessera.NewEntry([]byte(s)))(); err != nil { + t.Fatalf("dedupeAdd(%q): %v", s, err) + } + } idx, err := dedupeAdd(ctx, tessera.NewEntry([]byte(tC.newValue)))() if err != nil { - t.Fatal(err) + t.Fatalf("dedupeAdd(%q): %v", tC.newValue, err) } if idx != tC.wantIdx { t.Errorf("got != want (%d != %d)", idx, tC.wantIdx)