TestExtractEngineConfig_InlineDefinition verifies that an inline engine definition (engine.runtime + optional engine.provider) is correctly parsed from frontmatter into an EngineConfig with IsInlineDefinition=true.
(t *testing.T)
| 14 | // (engine.runtime + optional engine.provider) is correctly parsed from frontmatter |
| 15 | // into an EngineConfig with IsInlineDefinition=true. |
| 16 | func TestExtractEngineConfig_InlineDefinition(t *testing.T) { |
| 17 | tests := []struct { |
| 18 | name string |
| 19 | frontmatter map[string]any |
| 20 | expectedID string |
| 21 | expectedVersion string |
| 22 | expectedModel string |
| 23 | expectedProviderID string |
| 24 | expectedSecret string |
| 25 | expectedPermission string |
| 26 | expectInlineFlag bool |
| 27 | expectedEngineSetting string |
| 28 | }{ |
| 29 | { |
| 30 | name: "runtime only", |
| 31 | frontmatter: map[string]any{ |
| 32 | "engine": map[string]any{ |
| 33 | "runtime": map[string]any{ |
| 34 | "id": "codex", |
| 35 | }, |
| 36 | }, |
| 37 | }, |
| 38 | expectedID: "codex", |
| 39 | expectedEngineSetting: "codex", |
| 40 | expectInlineFlag: true, |
| 41 | }, |
| 42 | { |
| 43 | name: "runtime with version", |
| 44 | frontmatter: map[string]any{ |
| 45 | "engine": map[string]any{ |
| 46 | "runtime": map[string]any{ |
| 47 | "id": "codex", |
| 48 | "version": "0.105.0", |
| 49 | }, |
| 50 | }, |
| 51 | }, |
| 52 | expectedID: "codex", |
| 53 | expectedVersion: "0.105.0", |
| 54 | expectedEngineSetting: "codex", |
| 55 | expectInlineFlag: true, |
| 56 | }, |
| 57 | { |
| 58 | name: "runtime with permission mode", |
| 59 | frontmatter: map[string]any{ |
| 60 | "engine": map[string]any{ |
| 61 | "permission-mode": "plan", |
| 62 | "runtime": map[string]any{ |
| 63 | "id": "claude", |
| 64 | }, |
| 65 | }, |
| 66 | }, |
| 67 | expectedID: "claude", |
| 68 | expectedPermission: "plan", |
| 69 | expectedEngineSetting: "claude", |
| 70 | expectInlineFlag: true, |
| 71 | }, |
| 72 | { |
| 73 | name: "runtime and provider full", |
nothing calls this directly
no test coverage detected