(t *testing.T)
| 381 | } |
| 382 | |
| 383 | func TestFlowStepNamesMustBeUnique(t *testing.T) { |
| 384 | step := Step{Name: "work", Run: func(_ context.Context, in State) (State, error) { |
| 385 | return in, nil |
| 386 | }} |
| 387 | f := New("duplicate-steps", |
| 388 | WithCheckpoint(StoreCheckpoint(store.NewMemoryStore(), "duplicate-steps")), |
| 389 | Steps(step, step), |
| 390 | ) |
| 391 | |
| 392 | err := f.Execute(context.Background(), "") |
| 393 | if err == nil { |
| 394 | t.Fatal("expected duplicate step names to fail validation") |
| 395 | } |
| 396 | if got, want := err.Error(), `flow: duplicate step name "work"`; got != want { |
| 397 | t.Fatalf("error = %q, want %q", got, want) |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | func TestFlowStepNamesMustBeNonEmpty(t *testing.T) { |
| 402 | f := New("empty-step-name", |
nothing calls this directly
no test coverage detected
searching dependent graphs…