rara/packages/go/workflow/executor_test.go
toki fdc86c7ff4
Some checks are pending
ci / validate (push) Waiting to run
initial commit
2026-07-18 18:41:17 +09:00

26 lines
582 B
Go

package workflow
import (
"context"
"errors"
"testing"
)
func TestRegistryNoop(t *testing.T) {
registry := NewRegistry()
output, err := registry.Execute(context.Background(), "noop", []byte(`{"ok":true}`))
if err != nil {
t.Fatal(err)
}
if string(output) != `{"ok":true}` {
t.Fatalf("unexpected output %s", output)
}
}
func TestRegistryUnknownOperation(t *testing.T) {
registry := NewRegistry()
_, err := registry.Execute(context.Background(), "missing", nil)
if !errors.Is(err, ErrExecutorNotFound) {
t.Fatalf("expected ErrExecutorNotFound, got %v", err)
}
}