streamdata: iterator over known idents
Useful for searching. Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
"slices"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -301,6 +302,15 @@ func TestChannelAdd(t *testing.T) {
|
||||
t.Errorf("Add: %#v, want %#v", got, wantVOD)
|
||||
}
|
||||
|
||||
var iterErr error
|
||||
idents := slices.Collect(c.All(&iterErr))
|
||||
if iterErr != nil {
|
||||
t.Fatalf("All: error = %#v", iterErr)
|
||||
}
|
||||
if len(idents) != 1 || idents[0].String() != wantIdent {
|
||||
t.Errorf("All: %#v", idents)
|
||||
}
|
||||
|
||||
if gotVOD, err := c.Load(&ident); err != nil {
|
||||
t.Fatalf("Load: error = %v", err)
|
||||
} else if *gotVOD != wantVOD {
|
||||
|
||||
Reference in New Issue
Block a user