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

Function TestBranchPrefixInConfig

pkg/workflow/repo_memory_test.go:958–978  ·  view source on GitHub ↗

TestBranchPrefixInConfig tests branch-prefix in object configuration

(t *testing.T)

Source from the content-addressed store, hash-verified

956
957// TestBranchPrefixInConfig tests branch-prefix in object configuration
958func 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
981func TestBranchPrefixInArrayConfig(t *testing.T) {

Callers

nothing calls this directly

Calls 3

ParseToolsConfigFunction · 0.85
NewCompilerFunction · 0.85

Tested by

no test coverage detected