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

Function TestVersionRCNumber

scripts/releaser/version_test.go:85–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

83}
84
85func TestVersionRCNumber(t *testing.T) {
86 t.Parallel()
87
88 tests := []struct {
89 v version
90 want int
91 }{
92 {version{2, 32, 0, "rc.0"}, 0},
93 {version{2, 32, 0, "rc.5"}, 5},
94 {version{2, 32, 0, ""}, -1},
95 {version{2, 32, 0, "beta.1"}, -1},
96 }
97
98 for _, tt := range tests {
99 t.Run(tt.v.String(), func(t *testing.T) {
100 t.Parallel()
101 if got := tt.v.rcNumber(); got != tt.want {
102 t.Fatalf("rcNumber() = %d, want %d", got, tt.want)
103 }
104 })
105 }
106}
107
108func TestVersionGreaterThan(t *testing.T) {
109 t.Parallel()

Callers

nothing calls this directly

Calls 4

rcNumberMethod · 0.80
RunMethod · 0.65
StringMethod · 0.45
FatalfMethod · 0.45

Tested by

no test coverage detected