(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestGenerateWorkflowHeader_DirtyVersion(t *testing.T) { |
| 55 | // Save original version |
| 56 | originalVersion := compilerVersion |
| 57 | defer func() { compilerVersion = originalVersion }() |
| 58 | |
| 59 | // Test with dirty version (git describe output) - should NOT include version |
| 60 | // IsReleasedVersion excludes versions containing "dirty" |
| 61 | SetVersion("c610c2a-dirty") |
| 62 | header := GenerateWorkflowHeader("test.md", "gh-aw", "") |
| 63 | |
| 64 | if strings.Contains(header, "(c610c2a-dirty)") { |
| 65 | t.Error("Expected header to NOT include version for dirty builds") |
| 66 | } |
| 67 | if !strings.Contains(header, "This file was automatically generated by gh-aw. DO NOT EDIT.") { |
| 68 | t.Error("Expected header to contain disclaimer without version") |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func TestGenerateWorkflowHeader_GitHashVersion(t *testing.T) { |
| 73 | // Save original version |
nothing calls this directly
no test coverage detected