Skip to content

Commit

Permalink
Fix test to resolve futures
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Dec 5, 2024
1 parent 417214f commit 71cdbba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dedupe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 71cdbba

Please sign in to comment.