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

Function TestProcessIncludesWithWorkflowSpec_LegacySyntax

pkg/cli/imports_test.go:52–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestProcessIncludesWithWorkflowSpec_LegacySyntax(t *testing.T) {
53 // Test with legacy @include syntax
54 content := `---
55engine: claude
56---
57
58# Test Workflow
59
60Some content here.
61
62@include? shared/config.md
63
64More content.
65`
66
67 workflow := &WorkflowSpec{
68 RepoSpec: RepoSpec{
69 RepoSlug: "githubnext/agentics",
70 Version: "main",
71 },
72 }
73
74 result, err := processIncludesWithWorkflowSpec(content, workflow, "", "/tmp/package", "", false)
75 if err != nil {
76 t.Fatalf("Expected no error, got: %v", err)
77 }
78
79 // Should convert to @include with workflowspec
80 expectedInclude := "{{#import? githubnext/agentics/shared/config.md@main}}"
81 if !strings.Contains(result, expectedInclude) {
82 t.Errorf("Expected result to contain '%s'\nGot:\n%s", expectedInclude, result)
83 }
84}
85
86func TestProcessIncludesWithWorkflowSpec_WithCommitSHA(t *testing.T) {
87 // Test with commit SHA

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected