(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestExpandIncludesForEngines(t *testing.T) { |
| 16 | tests := []struct { |
| 17 | name string |
| 18 | includeFiles map[string]string |
| 19 | mainContent string |
| 20 | expectedLen int |
| 21 | expectedExact map[int]string |
| 22 | expectedContains map[int][]string |
| 23 | }{ |
| 24 | { |
| 25 | name: "single string engine", |
| 26 | includeFiles: map[string]string{ |
| 27 | "include-engine.md": `--- |
| 28 | engine: codex |
| 29 | tools: |
| 30 | github: |
| 31 | allowed: ["list_issues"] |
| 32 | --- |
| 33 | |
| 34 | # Include with Engine |
| 35 | `, |
| 36 | }, |
| 37 | mainContent: `# Main Workflow |
| 38 | |
| 39 | @include include-engine.md |
| 40 | |
| 41 | Some content here. |
| 42 | `, |
| 43 | expectedLen: 1, |
| 44 | expectedExact: map[int]string{0: `"codex"`}, |
| 45 | }, |
| 46 | { |
| 47 | name: "object format engine", |
| 48 | includeFiles: map[string]string{ |
| 49 | "include-object-engine.md": `--- |
| 50 | engine: |
| 51 | id: claude |
| 52 | model: claude-3-5-sonnet-20241022 |
| 53 | max-turns: 5 |
| 54 | tools: |
| 55 | github: |
| 56 | allowed: ["list_issues"] |
| 57 | --- |
| 58 | |
| 59 | # Include with Object Engine |
| 60 | `, |
| 61 | }, |
| 62 | mainContent: `# Main Workflow |
| 63 | |
| 64 | @include include-object-engine.md |
| 65 | |
| 66 | Some content here. |
| 67 | `, |
| 68 | expectedLen: 1, |
| 69 | expectedContains: map[int][]string{ |
| 70 | 0: {`"id":"claude"`, `"model":"claude-3-5-sonnet-20241022"`, `"max-turns":5`}, |
| 71 | }, |
| 72 | }, |
nothing calls this directly
no test coverage detected