streamdata: iterator over known idents

Useful for searching.

Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
2026-03-19 01:44:42 +09:00
parent 522b576cfa
commit c6da581ec0
2 changed files with 46 additions and 0 deletions

View File

@@ -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 {