(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestLoadWorkflowJSON(t *testing.T) { |
| 64 | dir := t.TempDir() |
| 65 | path := filepath.Join(dir, "wf.json") |
| 66 | os.WriteFile(path, []byte(`{"steps":[{"pattern":"a"},{"pattern":"b"}]}`), 0o644) |
| 67 | |
| 68 | wf, err := LoadWorkflow(path) |
| 69 | if err != nil { |
| 70 | t.Fatalf("unexpected error: %v", err) |
| 71 | } |
| 72 | if len(wf.Steps) != 2 || wf.Steps[1].Pattern != "b" { |
| 73 | t.Fatalf("unexpected steps: %+v", wf.Steps) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | func TestLoadWorkflowBadPath(t *testing.T) { |
| 78 | tests := []struct { |
nothing calls this directly
no test coverage detected