generation-aware playback statuses

This commit is contained in:
Dmitry Sergeev
2026-09-01 18:03:18 +03:00
parent 7a19fe0dad
commit 9bc08109fc
12 changed files with 210 additions and 41 deletions
+11
View File
@@ -1,11 +1,22 @@
package playback
import (
"context"
"errors"
"testing"
"time"
)
func TestGenerationContext(t *testing.T) {
if got := generationFromContext(context.Background()); got != 0 {
t.Fatalf("background generation = %d, want 0", got)
}
ctx := withGeneration(context.Background(), 42)
if got := generationFromContext(ctx); got != 42 {
t.Fatalf("generation = %d, want 42", got)
}
}
func TestStatusPreservesValues(t *testing.T) {
wantErr := errors.New("producer missing")
status := Status{