(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestGenerateWorkflowHeader_VersionInDevBuild(t *testing.T) { |
| 11 | // Save original version |
| 12 | originalVersion := compilerVersion |
| 13 | defer func() { compilerVersion = originalVersion }() |
| 14 | |
| 15 | // Test with dev version - should not include version in header |
| 16 | SetVersion("dev") |
| 17 | header := GenerateWorkflowHeader("test.md", "gh-aw", "") |
| 18 | |
| 19 | if strings.Contains(header, "(dev)") { |
| 20 | t.Error("Expected header to NOT include version for dev builds") |
| 21 | } |
| 22 | if !strings.Contains(header, "This file was automatically generated by gh-aw. DO NOT EDIT.") { |
| 23 | t.Error("Expected header to contain disclaimer without version") |
| 24 | } |
| 25 | // Verify auto-generated notice is on the first line |
| 26 | firstLine := strings.SplitN(header, "\n", 2)[0] |
| 27 | if !strings.HasPrefix(firstLine, "# This file was automatically generated") { |
| 28 | t.Errorf("Expected auto-generated notice on first line, got: %s", firstLine) |
| 29 | } |
| 30 | if !strings.Contains(firstLine, "https://github.com/github/gh-aw/blob/main/debug.md") { |
| 31 | t.Errorf("Expected skill URL on first line, got: %s", firstLine) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func TestGenerateWorkflowHeader_VersionInReleaseBuild(t *testing.T) { |
| 36 | // Save original state |
nothing calls this directly
no test coverage detected