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

Function TestSetVersionAndGetVersion

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

Source from the content-addressed store, hash-verified

7)
8
9func TestSetVersionAndGetVersion(t *testing.T) {
10 // Save original version
11 originalVersion := compilerVersion
12 defer func() { compilerVersion = originalVersion }()
13
14 tests := []struct {
15 version string
16 }{
17 {"1.0.0"},
18 {"dev"},
19 {"v2.3.4"},
20 {""},
21 }
22
23 for _, tt := range tests {
24 t.Run(tt.version, func(t *testing.T) {
25 SetVersion(tt.version)
26 if got := GetVersion(); got != tt.version {
27 t.Errorf("GetVersion() = %q, want %q", got, tt.version)
28 }
29 })
30 }
31}
32
33func TestSetIsReleaseAndIsRelease(t *testing.T) {
34 // Save original isReleaseBuild

Callers

nothing calls this directly

Calls 4

SetVersionFunction · 0.85
GetVersionFunction · 0.70
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected