display video worker status
This commit is contained in:
@@ -38,3 +38,42 @@ func TestStatusPreservesValues(t *testing.T) {
|
||||
t.Errorf("RetryIn = %s, want %s", status.RetryIn, time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnitString(t *testing.T) {
|
||||
tests := []struct {
|
||||
unit Unit
|
||||
want string
|
||||
}{
|
||||
{unit: UnitVideo, want: "video"},
|
||||
{unit: UnitAudio, want: "audio"},
|
||||
{unit: UnitSync, want: "sync"},
|
||||
{unit: Unit(255), want: "Unit(255)"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
if got := tt.unit.String(); got != tt.want {
|
||||
t.Errorf("Unit(%d).String() = %q, want %q", tt.unit, got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestStateString(t *testing.T) {
|
||||
tests := []struct {
|
||||
state State
|
||||
want string
|
||||
}{
|
||||
{state: StateIdle, want: "idle"},
|
||||
{state: StateConnecting, want: "connecting"},
|
||||
{state: StatePlaying, want: "playing"},
|
||||
{state: StateReconnecting, want: "reconnecting"},
|
||||
{state: StateFailed, want: "failed"},
|
||||
{state: StateStopping, want: "stopping"},
|
||||
{state: State(255), want: "State(255)"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
if got := tt.state.String(); got != tt.want {
|
||||
t.Errorf("State(%d).String() = %q, want %q", tt.state, got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user