|
- package app
-
- import (
- "testing"
-
- cfgpkg "github.com/jan/fm-rds-tx/internal/config"
- "github.com/jan/fm-rds-tx/internal/platform"
- )
-
- func TestEngineRuntimeStateReporting(t *testing.T) {
- e := NewEngine(cfgpkg.Default(), platform.NewSimulatedDriver(nil))
-
- if got := e.Stats().State; got != string(RuntimeStateIdle) {
- t.Fatalf("expected initial state idle, got %s", got)
- }
-
- e.setRuntimeState(RuntimeStatePrebuffering)
- if got := e.Stats().State; got != string(RuntimeStatePrebuffering) {
- t.Fatalf("expected prebuffering, got %s", got)
- }
-
- e.setRuntimeState(RuntimeStateRunning)
- if got := e.currentRuntimeState(); got != RuntimeStateRunning {
- t.Fatalf("currentRuntimeState mismatch: %s", got)
- }
- }
|