TestBranchPrefixInConfig tests branch-prefix in object configuration
(t *testing.T)
| 956 | |
| 957 | // TestBranchPrefixInConfig tests branch-prefix in object configuration |
| 958 | func TestBranchPrefixInConfig(t *testing.T) { |
| 959 | toolsMap := map[string]any{ |
| 960 | "repo-memory": map[string]any{ |
| 961 | "branch-prefix": "campaigns", |
| 962 | }, |
| 963 | } |
| 964 | |
| 965 | toolsConfig, err := ParseToolsConfig(toolsMap) |
| 966 | require.NoError(t, err, "Failed to parse tools config") |
| 967 | |
| 968 | compiler := NewCompiler() |
| 969 | config, err := compiler.extractRepoMemoryConfig(toolsConfig, "my-workflow") |
| 970 | require.NoError(t, err, "Failed to extract repo-memory config") |
| 971 | require.NotNil(t, config, "Expected non-nil config") |
| 972 | |
| 973 | assert.Equal(t, "campaigns", config.BranchPrefix, "Expected branch-prefix 'campaigns'") |
| 974 | assert.Len(t, config.Memories, 1, "Expected 1 memory") |
| 975 | |
| 976 | memory := config.Memories[0] |
| 977 | assert.Equal(t, "campaigns/my-workflow", memory.BranchName, "Expected branch name 'campaigns/my-workflow'") |
| 978 | } |
| 979 | |
| 980 | // TestBranchPrefixInArrayConfig tests branch-prefix in array configuration |
| 981 | func TestBranchPrefixInArrayConfig(t *testing.T) { |
nothing calls this directly
no test coverage detected