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

Function TestProcessIncludesWithWorkflowSpec_NewSyntax

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

Source from the content-addressed store, hash-verified

10)
11
12func TestProcessIncludesWithWorkflowSpec_NewSyntax(t *testing.T) {
13 // Test with new {{#import}} syntax
14 content := `---
15engine: claude
16---
17
18# Test Workflow
19
20Some content here.
21
22{{#import? agentics/weekly-research.config}}
23
24More content.
25`
26
27 workflow := &WorkflowSpec{
28 RepoSpec: RepoSpec{
29 RepoSlug: "githubnext/agentics",
30 Version: "main",
31 },
32 }
33
34 result, err := processIncludesWithWorkflowSpec(content, workflow, "", "/tmp/package", "", false)
35 if err != nil {
36 t.Fatalf("Expected no error, got: %v", err)
37 }
38
39 // Should convert to @include with workflowspec
40 expectedInclude := "{{#import? githubnext/agentics/agentics/weekly-research.config@main}}"
41 if !strings.Contains(result, expectedInclude) {
42 t.Errorf("Expected result to contain '%s'\nGot:\n%s", expectedInclude, result)
43 }
44
45 // Should NOT contain the malformed path
46 malformedPath := "githubnext/agentics/@"
47 if strings.Contains(result, malformedPath) {
48 t.Errorf("Result should NOT contain malformed path '%s'\nGot:\n%s", malformedPath, result)
49 }
50}
51
52func TestProcessIncludesWithWorkflowSpec_LegacySyntax(t *testing.T) {
53 // Test with legacy @include syntax

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected