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

Function TestExtractWorkflowDependencies

pkg/cli/status_dependency_tree_test.go:11–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestExtractWorkflowDependencies(t *testing.T) {
12 frontmatter := map[string]any{
13 "imports": []any{
14 "shared/base.md#section",
15 map[string]any{"uses": "owner/repo/.github/workflows/common.md@main"},
16 },
17 }
18 content := `
19@include local/helpers.md#part
20@import shared/base.md
21`
22
23 got := extractWorkflowDependencies(content, frontmatter)
24 want := []string{
25 "local/helpers.md",
26 "owner/repo/.github/workflows/common.md@main",
27 "shared/base.md",
28 }
29
30 assert.Len(t, got, len(want), "dependency count should match expected unique set")
31 for i := range want {
32 assert.Equal(t, want[i], got[i], "dependency should match normalized and sorted value")
33 }
34}
35
36func TestExtractWorkflowDependencies_ImportsObjectAW(t *testing.T) {
37 frontmatter := map[string]any{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected