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

Function TestEngineVersionNotProvided

pkg/workflow/engine_test.go:136–172  ·  view source on GitHub ↗

TestEngineVersionNotProvided tests that when no version is provided, the Version field remains empty (default behavior).

(t *testing.T)

Source from the content-addressed store, hash-verified

134// TestEngineVersionNotProvided tests that when no version is provided,
135// the Version field remains empty (default behavior).
136func TestEngineVersionNotProvided(t *testing.T) {
137 tests := []struct {
138 name string
139 frontmatter map[string]any
140 }{
141 {
142 name: "engine without version field",
143 frontmatter: map[string]any{
144 "engine": map[string]any{
145 "id": "copilot",
146 },
147 },
148 },
149 {
150 name: "engine as string (backward compatibility)",
151 frontmatter: map[string]any{
152 "engine": "copilot",
153 },
154 },
155 }
156
157 compiler := NewCompiler()
158
159 for _, tt := range tests {
160 t.Run(tt.name, func(t *testing.T) {
161 _, config := compiler.ExtractEngineConfig(tt.frontmatter)
162
163 if config == nil {
164 t.Fatal("Expected config to be non-nil")
165 }
166
167 if config.Version != "" {
168 t.Errorf("Expected empty version, got %q", config.Version)
169 }
170 })
171 }
172}
173
174// TestEngineVersionWithOtherFields tests that version works correctly
175// alongside other engine configuration fields.

Callers

nothing calls this directly

Calls 4

ExtractEngineConfigMethod · 0.95
NewCompilerFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected