(t *testing.T)
| 114 | } |
| 115 | |
| 116 | func TestEnginePermissionModeFieldExtraction(t *testing.T) { |
| 117 | compiler := NewCompiler() |
| 118 | |
| 119 | t.Run("extracts engine permission-mode", func(t *testing.T) { |
| 120 | frontmatter := map[string]any{ |
| 121 | "engine": map[string]any{ |
| 122 | "id": "claude", |
| 123 | "permission-mode": "auto", |
| 124 | }, |
| 125 | } |
| 126 | |
| 127 | _, config := compiler.ExtractEngineConfig(frontmatter) |
| 128 | if config == nil { |
| 129 | t.Fatal("Expected config to be non-nil") |
| 130 | } |
| 131 | if config.PermissionMode != "auto" { |
| 132 | t.Errorf("Expected permission mode auto, got %q", config.PermissionMode) |
| 133 | } |
| 134 | }) |
| 135 | |
| 136 | t.Run("permission-mode omitted keeps empty default", func(t *testing.T) { |
| 137 | frontmatter := map[string]any{ |
| 138 | "engine": map[string]any{ |
| 139 | "id": "claude", |
| 140 | }, |
| 141 | } |
| 142 | |
| 143 | _, config := compiler.ExtractEngineConfig(frontmatter) |
| 144 | if config == nil { |
| 145 | t.Fatal("Expected config to be non-nil") |
| 146 | } |
| 147 | if config.PermissionMode != "" { |
| 148 | t.Errorf("Expected empty permission mode, got %q", config.PermissionMode) |
| 149 | } |
| 150 | }) |
| 151 | } |
| 152 | |
| 153 | func TestEngineExtensionsFieldExtraction(t *testing.T) { |
| 154 | compiler := NewCompiler() |
nothing calls this directly
no test coverage detected