(t *testing.T)
| 115 | } |
| 116 | |
| 117 | func TestProcessIncludesWithWorkflowSpec_EmptyFilePath(t *testing.T) { |
| 118 | // Test with section-only reference (should be skipped/passed through) |
| 119 | content := `--- |
| 120 | engine: claude |
| 121 | --- |
| 122 | |
| 123 | # Test Workflow |
| 124 | |
| 125 | {{#import? #SectionName}} |
| 126 | |
| 127 | More content. |
| 128 | ` |
| 129 | |
| 130 | workflow := &WorkflowSpec{ |
| 131 | RepoSpec: RepoSpec{ |
| 132 | RepoSlug: "githubnext/agentics", |
| 133 | Version: "main", |
| 134 | }, |
| 135 | } |
| 136 | |
| 137 | result, err := processIncludesWithWorkflowSpec(content, workflow, "", "/tmp/package", "", false) |
| 138 | if err != nil { |
| 139 | t.Fatalf("Expected no error, got: %v", err) |
| 140 | } |
| 141 | |
| 142 | // Should preserve the original line when filePath is empty |
| 143 | if !strings.Contains(result, "{{#import? #SectionName}}") { |
| 144 | t.Errorf("Expected result to preserve original line\nGot:\n%s", result) |
| 145 | } |
| 146 | |
| 147 | // Should NOT generate malformed workflowspec |
| 148 | malformedPath := "githubnext/agentics/@" |
| 149 | if strings.Contains(result, malformedPath) { |
| 150 | t.Errorf("Result should NOT contain malformed path '%s'\nGot:\n%s", malformedPath, result) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func TestProcessIncludesInContent_NewSyntax(t *testing.T) { |
| 155 | // Test processIncludesInContent with new syntax |
nothing calls this directly
no test coverage detected