MCPcopy Create free account
hub / github.com/github/gh-aw / TestGenerateWorkflowHeader_GitHashVersion

Function TestGenerateWorkflowHeader_GitHashVersion

pkg/workflow/header_test.go:72–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func 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
90func TestGenerateWorkflowHeader_EmptyVersion(t *testing.T) {
91 // Save original version

Callers

nothing calls this directly

Calls 3

SetVersionFunction · 0.85
GenerateWorkflowHeaderFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected