(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestProcessIncludesWithWorkflowSpec_WithCommitSHA(t *testing.T) { |
| 87 | // Test with commit SHA |
| 88 | content := `--- |
| 89 | engine: claude |
| 90 | --- |
| 91 | |
| 92 | # Test Workflow |
| 93 | |
| 94 | {{#import agentics/config.md}} |
| 95 | ` |
| 96 | |
| 97 | workflow := &WorkflowSpec{ |
| 98 | RepoSpec: RepoSpec{ |
| 99 | RepoSlug: "githubnext/agentics", |
| 100 | }, |
| 101 | } |
| 102 | |
| 103 | commitSHA := "e2770974a7eaccb58ddafd5606c38a05ba52c631" |
| 104 | |
| 105 | result, err := processIncludesWithWorkflowSpec(content, workflow, commitSHA, "/tmp/package", "", false) |
| 106 | if err != nil { |
| 107 | t.Fatalf("Expected no error, got: %v", err) |
| 108 | } |
| 109 | |
| 110 | // Should use commit SHA instead of version |
| 111 | expectedInclude := "{{#import githubnext/agentics/agentics/config.md@e2770974a7eaccb58ddafd5606c38a05ba52c631}}" |
| 112 | if !strings.Contains(result, expectedInclude) { |
| 113 | t.Errorf("Expected result to contain '%s'\nGot:\n%s", expectedInclude, result) |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | func TestProcessIncludesWithWorkflowSpec_EmptyFilePath(t *testing.T) { |
| 118 | // Test with section-only reference (should be skipped/passed through) |
nothing calls this directly
no test coverage detected