(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestGenerateWorkflowHeader_GitHashVersion(t *testing.T) { |
| 73 | // Save original version |
| 74 | originalVersion := compilerVersion |
| 75 | defer func() { compilerVersion = originalVersion }() |
| 76 | |
| 77 | // Test with git hash version - should NOT include version |
| 78 | // IsReleasedVersion requires proper semver format |
| 79 | SetVersion("c610c2a") |
| 80 | header := GenerateWorkflowHeader("test.md", "gh-aw", "") |
| 81 | |
| 82 | if strings.Contains(header, "(c610c2a)") { |
| 83 | t.Error("Expected header to NOT include version for git hash builds") |
| 84 | } |
| 85 | if !strings.Contains(header, "This file was automatically generated by gh-aw. DO NOT EDIT.") { |
| 86 | t.Error("Expected header to contain disclaimer without version") |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | func TestGenerateWorkflowHeader_EmptyVersion(t *testing.T) { |
| 91 | // Save original version |
nothing calls this directly
no test coverage detected