From 65632c89c35da17451f3538094f3b1de9fc5e5ba Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 18 Nov 2024 17:34:52 -0300 Subject: [PATCH] ok, this is a bug we already had: if an event matches two different tag queries it will be returned twice. --- test/first_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/first_test.go b/test/first_test.go index 1b4552e..e34f13f 100644 --- a/test/first_test.go +++ b/test/first_test.go @@ -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") + } } } }