define playback worker status

This commit is contained in:
Dmitry Sergeev
2026-08-27 09:38:35 +03:00
parent 8bb48d51ea
commit 418d0fc102
2 changed files with 48 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package playback
import (
"errors"
"testing"
"time"
)
func TestStatusPreservesValues(t *testing.T) {
wantErr := errors.New("producer missing")
status := Status{
Unit: UnitVideo,
State: StateReconnecting,
Attempt: 2,
FailedAttempts: 1,
RetryIn: time.Second,
Err: wantErr,
}
if status.Unit != UnitVideo {
t.Errorf("Unit = %v, want %v", status.Unit, UnitVideo)
}
// Check the remaining fields similarly.
if !errors.Is(status.Err, wantErr) {
t.Errorf("Err = %v, want %v", status.Err, wantErr)
}
}