TestEngineVersionWithOtherFields tests that version works correctly alongside other engine configuration fields.
(t *testing.T)
| 174 | // TestEngineVersionWithOtherFields tests that version works correctly |
| 175 | // alongside other engine configuration fields. |
| 176 | func TestEngineVersionWithOtherFields(t *testing.T) { |
| 177 | frontmatter := map[string]any{ |
| 178 | "engine": map[string]any{ |
| 179 | "id": "copilot", |
| 180 | "version": "0.0.369", |
| 181 | "model": "gpt-4", |
| 182 | "env": map[string]any{ |
| 183 | "DEBUG": "true", |
| 184 | }, |
| 185 | }, |
| 186 | } |
| 187 | |
| 188 | compiler := NewCompiler() |
| 189 | _, config := compiler.ExtractEngineConfig(frontmatter) |
| 190 | |
| 191 | if config == nil { |
| 192 | t.Fatal("Expected config to be non-nil") |
| 193 | } |
| 194 | |
| 195 | if config.ID != "copilot" { |
| 196 | t.Errorf("Expected ID 'copilot', got %q", config.ID) |
| 197 | } |
| 198 | |
| 199 | if config.Version != "0.0.369" { |
| 200 | t.Errorf("Expected version '0.0.369', got %q", config.Version) |
| 201 | } |
| 202 | |
| 203 | if config.Model != "gpt-4" { |
| 204 | t.Errorf("Expected model 'gpt-4', got %q", config.Model) |
| 205 | } |
| 206 | |
| 207 | if len(config.Env) != 1 { |
| 208 | t.Errorf("Expected 1 env var, got %d", len(config.Env)) |
| 209 | } |
| 210 | |
| 211 | if config.Env["DEBUG"] != "true" { |
| 212 | t.Errorf("Expected DEBUG='true', got %q", config.Env["DEBUG"]) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // TestEngineCommandField tests that the command field is correctly extracted |
| 217 | func TestEngineCommandField(t *testing.T) { |
nothing calls this directly
no test coverage detected