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

Function TestEnginePermissionModeFieldExtraction

pkg/workflow/engine_args_test.go:116–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func 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
153func TestEngineExtensionsFieldExtraction(t *testing.T) {
154 compiler := NewCompiler()

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