mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-21 19:48:50 +01:00
I had forgotten to implement Tags.FindAll()
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package nostr
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -18,7 +19,7 @@ func TestTagHelpers(t *testing.T) {
|
||||
assert.Nil(t, tags.Find("x"), "Find shouldn't have returned a tag with a single item")
|
||||
assert.NotNil(t, tags.FindWithValue("p", "abcdef"), "failed to get with existing prefix")
|
||||
assert.Equal(t, "ffffff", tags.FindLast("e")[1], "failed to get last")
|
||||
assert.Equal(t, 2, len(tags.GetAll([]string{"e", ""})), "failed to get all")
|
||||
assert.Equal(t, 2, len(slices.Collect(tags.FindAll("e"))), "failed to get all")
|
||||
c := make(Tags, 0, 2)
|
||||
for _, tag := range tags.All([]string{"e", ""}) {
|
||||
c = append(c, tag)
|
||||
|
||||
Reference in New Issue
Block a user