Skip to content

Commit

Permalink
ok, this is a bug we already had: if an event matches two different t…
Browse files Browse the repository at this point in the history
…ag queries it will be returned twice.
  • Loading branch information
fiatjaf committed Nov 18, 2024
1 parent 6adb45c commit 65632c8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/first_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ func runFirstTestOn(t *testing.T, db eventstore.Store) {
Limit: 4,
})
require.NoError(t, err)
require.ElementsMatch(t,
// the results won't be in canonical time order because this query is too awful, needs a kind
[]*nostr.Event{newEvents[5], newEvents[6], newEvents[7]},
results,
"'p' tag 3 query error")

for _, idx := range []int{5, 6, 7} {
require.True(t,
slices.ContainsFunc(
results,
func(evt *nostr.Event) bool { return evt.ID == newEvents[idx].ID },
),
"'p' tag 3 query error")
}
}
}
}

0 comments on commit 65632c8

Please sign in to comment.