MCPcopy Create free account
hub / github.com/github/gh-aw / TestEngineVersionWithOtherFields

Function TestEngineVersionWithOtherFields

pkg/workflow/engine_test.go:176–214  ·  view source on GitHub ↗

TestEngineVersionWithOtherFields tests that version works correctly alongside other engine configuration fields.

(t *testing.T)

Source from the content-addressed store, hash-verified

174// TestEngineVersionWithOtherFields tests that version works correctly
175// alongside other engine configuration fields.
176func 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
217func TestEngineCommandField(t *testing.T) {

Callers

nothing calls this directly

Calls 3

ExtractEngineConfigMethod · 0.95
NewCompilerFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected