TestRepoMemoryConfigDuplicateIDs tests that duplicate memory IDs are rejected
(t *testing.T)
| 164 | |
| 165 | // TestRepoMemoryConfigDuplicateIDs tests that duplicate memory IDs are rejected |
| 166 | func 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 |
| 197 | func TestRepoMemoryStepsGeneration(t *testing.T) { |
nothing calls this directly
no test coverage detected