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

Function TestSetIsReleaseAndIsRelease

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

Source from the content-addressed store, hash-verified

31}
32
33func TestSetIsReleaseAndIsRelease(t *testing.T) {
34 // Save original isReleaseBuild
35 originalIsRelease := isReleaseBuild
36 defer func() { isReleaseBuild = originalIsRelease }()
37
38 tests := []struct {
39 name string
40 value bool
41 expected bool
42 }{
43 {"Set true", true, true},
44 {"Set false", false, false},
45 }
46
47 for _, tt := range tests {
48 t.Run(tt.name, func(t *testing.T) {
49 SetIsRelease(tt.value)
50 if got := IsRelease(); got != tt.expected {
51 t.Errorf("IsRelease() = %v, want %v", got, tt.expected)
52 }
53 })
54 }
55}
56
57func TestIsReleasedVersion_WithReleaseFlag(t *testing.T) {
58 // Save original state

Callers

nothing calls this directly

Calls 4

SetIsReleaseFunction · 0.85
IsReleaseFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected