MCPcopy Index your code
hub / github.com/coder/coder / TestVersionSupportsPprof

Function TestVersionSupportsPprof

support/version_test.go:9–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestVersionSupportsPprof(t *testing.T) {
10 t.Parallel()
11 tests := []struct {
12 version string
13 want bool
14 }{
15 {"", false},
16 {"v2.27.0", false},
17 {"v2.27.9", false},
18 {"v2.28.0", true},
19 {"v2.28.1", true},
20 {"v2.29.0", true},
21 {"v3.0.0", true},
22 {"2.28.0", true}, // without v prefix
23 {"2.27.0", false}, // without v prefix
24 {"v2.28.0-devel+abc123", true}, // dev version
25 {"v2.27.0-devel+abc123", false},
26 }
27 for _, tt := range tests {
28 t.Run(tt.version, func(t *testing.T) {
29 t.Parallel()
30 got := support.VersionSupportsPprof(tt.version)
31 if got != tt.want {
32 t.Errorf("versionSupportsPprof(%q) = %v, want %v", tt.version, got, tt.want)
33 }
34 })
35 }
36}

Callers

nothing calls this directly

Calls 3

VersionSupportsPprofFunction · 0.92
RunMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected