TestRepoMemoryConfigDefault tests basic repo-memory configuration with boolean true
(t *testing.T)
| 12 | |
| 13 | // TestRepoMemoryConfigDefault tests basic repo-memory configuration with boolean true |
| 14 | func TestRepoMemoryConfigDefault(t *testing.T) { |
| 15 | toolsMap := map[string]any{ |
| 16 | "repo-memory": true, |
| 17 | } |
| 18 | |
| 19 | toolsConfig, err := ParseToolsConfig(toolsMap) |
| 20 | if err != nil { |
| 21 | t.Fatalf("Failed to parse tools config: %v", err) |
| 22 | } |
| 23 | |
| 24 | compiler := NewCompiler() |
| 25 | config, err := compiler.extractRepoMemoryConfig(toolsConfig, "my-workflow") |
| 26 | if err != nil { |
| 27 | t.Fatalf("Failed to extract repo-memory config: %v", err) |
| 28 | } |
| 29 | |
| 30 | if config == nil { |
| 31 | t.Fatal("Expected non-nil config") |
| 32 | } |
| 33 | |
| 34 | if len(config.Memories) != 1 { |
| 35 | t.Fatalf("Expected 1 memory, got %d", len(config.Memories)) |
| 36 | } |
| 37 | |
| 38 | memory := config.Memories[0] |
| 39 | if memory.ID != "default" { |
| 40 | t.Errorf("Expected ID 'default', got '%s'", memory.ID) |
| 41 | } |
| 42 | |
| 43 | if memory.BranchName != "memory/my-workflow" { |
| 44 | t.Errorf("Expected branch name 'memory/my-workflow', got '%s'", memory.BranchName) |
| 45 | } |
| 46 | |
| 47 | if memory.MaxFileSize != 102400 { |
| 48 | t.Errorf("Expected max file size 102400, got %d", memory.MaxFileSize) |
| 49 | } |
| 50 | |
| 51 | if memory.MaxFileCount != 100 { |
| 52 | t.Errorf("Expected max file count 100, got %d", memory.MaxFileCount) |
| 53 | } |
| 54 | |
| 55 | if !memory.CreateOrphan { |
| 56 | t.Error("Expected create-orphan to be true by default") |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // TestRepoMemoryConfigObject tests repo-memory configuration with object notation |
| 61 | func TestRepoMemoryConfigObject(t *testing.T) { |
nothing calls this directly
no test coverage detected