(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestProcessIncludesWithWorkflowSpec_NewSyntax(t *testing.T) { |
| 13 | // Test with new {{#import}} syntax |
| 14 | content := `--- |
| 15 | engine: claude |
| 16 | --- |
| 17 | |
| 18 | # Test Workflow |
| 19 | |
| 20 | Some content here. |
| 21 | |
| 22 | {{#import? agentics/weekly-research.config}} |
| 23 | |
| 24 | More 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 | |
| 52 | func TestProcessIncludesWithWorkflowSpec_LegacySyntax(t *testing.T) { |
| 53 | // Test with legacy @include syntax |
nothing calls this directly
no test coverage detected