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

Function TestGenerateWorkflowHeader_DirtyVersion

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

Source from the content-addressed store, hash-verified

52}
53
54func 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
72func TestGenerateWorkflowHeader_GitHashVersion(t *testing.T) {
73 // 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