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

Function TestGenerateWorkflowHeader_VersionInDevBuild

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

Source from the content-addressed store, hash-verified

8)
9
10func 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
35func TestGenerateWorkflowHeader_VersionInReleaseBuild(t *testing.T) {
36 // Save original state

Callers

nothing calls this directly

Calls 4

SetVersionFunction · 0.85
GenerateWorkflowHeaderFunction · 0.85
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected