From 28e3c99ad880e27081e5757d396c1378c2fa2f52 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 8 Feb 2026 15:56:33 -0600 Subject: [PATCH] add test loading from registry for time.sleep --- internal/processor/time-sleep_test.go | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 internal/processor/time-sleep_test.go diff --git a/internal/processor/time-sleep_test.go b/internal/processor/time-sleep_test.go new file mode 100644 index 0000000..3a0b41c --- /dev/null +++ b/internal/processor/time-sleep_test.go @@ -0,0 +1,30 @@ +package processor_test + +import ( + "testing" + + "github.com/jwetzell/showbridge-go/internal/config" + "github.com/jwetzell/showbridge-go/internal/processor" +) + +func TestTimeSleepFromRegistry(t *testing.T) { + registration, ok := processor.ProcessorRegistry["time.sleep"] + if !ok { + t.Fatalf("time.sleep processor not registered") + } + + processorInstance, err := registration.New(config.ProcessorConfig{ + Type: "time.sleep", + Params: map[string]any{ + "duration": 1000.0, + }, + }) + + if err != nil { + t.Fatalf("failed to create time.sleep processor: %s", err) + } + + if processorInstance.Type() != "time.sleep" { + t.Fatalf("time.sleep processor has wrong type: %s", processorInstance.Type()) + } +}