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

Function TestRepoMemoryConfigDuplicateIDs

pkg/workflow/repo_memory_test.go:166–194  ·  view source on GitHub ↗

TestRepoMemoryConfigDuplicateIDs tests that duplicate memory IDs are rejected

(t *testing.T)

Source from the content-addressed store, hash-verified

164
165// TestRepoMemoryConfigDuplicateIDs tests that duplicate memory IDs are rejected
166func TestRepoMemoryConfigDuplicateIDs(t *testing.T) {
167 toolsMap := map[string]any{
168 "repo-memory": []any{
169 map[string]any{
170 "id": "session",
171 "branch-name": "memory/session",
172 },
173 map[string]any{
174 "id": "session",
175 "branch-name": "memory/session2",
176 },
177 },
178 }
179
180 toolsConfig, err := ParseToolsConfig(toolsMap)
181 if err != nil {
182 t.Fatalf("Failed to parse tools config: %v", err)
183 }
184
185 compiler := NewCompiler()
186 _, err = compiler.extractRepoMemoryConfig(toolsConfig, "")
187 if err == nil {
188 t.Fatal("Expected error for duplicate memory IDs, got nil")
189 }
190
191 if !strings.Contains(err.Error(), "duplicate memory ID") {
192 t.Errorf("Expected error about duplicate memory ID, got: %v", err)
193 }
194}
195
196// TestRepoMemoryStepsGeneration tests that repo-memory steps are generated correctly
197func TestRepoMemoryStepsGeneration(t *testing.T) {

Callers

nothing calls this directly

Calls 5

ParseToolsConfigFunction · 0.85
NewCompilerFunction · 0.85
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected