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

Function TestVersionEqual

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

Source from the content-addressed store, hash-verified

144}
145
146func TestVersionEqual(t *testing.T) {
147 t.Parallel()
148
149 tests := []struct {
150 a, b version
151 want bool
152 }{
153 {version{2, 32, 0, ""}, version{2, 32, 0, ""}, true},
154 {version{2, 32, 0, "rc.0"}, version{2, 32, 0, "rc.0"}, true},
155 {version{2, 32, 0, ""}, version{2, 32, 0, "rc.0"}, false},
156 {version{2, 32, 0, "rc.0"}, version{2, 32, 0, "rc.1"}, false},
157 }
158
159 for _, tt := range tests {
160 t.Run(tt.a.String()+"_eq_"+tt.b.String(), func(t *testing.T) {
161 t.Parallel()
162 if got := tt.a.Equal(tt.b); got != tt.want {
163 t.Fatalf("%s.Equal(%s) = %v, want %v", tt.a, tt.b, got, tt.want)
164 }
165 })
166 }
167}
168
169func TestSortVersionsDesc(t *testing.T) {
170 t.Parallel()

Callers

nothing calls this directly

Calls 4

RunMethod · 0.65
StringMethod · 0.45
EqualMethod · 0.45
FatalfMethod · 0.45

Tested by

no test coverage detected