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

Function Test_serverVersionMessage

cli/root_internal_test.go:189–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

187}
188
189func Test_serverVersionMessage(t *testing.T) {
190 t.Parallel()
191
192 cases := []struct {
193 name string
194 version string
195 expected string
196 }{
197 {"Stable", "v2.31.0", ""},
198 {"Dev", "v0.0.0-devel+abc123", "the server is running a development version of Coder (v0.0.0-devel+abc123)"},
199 {"RC", "v2.31.0-rc.1", "the server is running a release candidate of Coder (v2.31.0-rc.1)"},
200 {"RCDevel", "v2.33.0-rc.1-devel+727ec00f7", "the server is running a release candidate of Coder (v2.33.0-rc.1-devel+727ec00f7)"},
201 {"Empty", "", ""},
202 }
203
204 for _, c := range cases {
205 t.Run(c.name, func(t *testing.T) {
206 t.Parallel()
207 require.Equal(t, c.expected, serverVersionMessage(c.version))
208 })
209 }
210}
211
212func Test_wrapTransportWithTelemetryHeader(t *testing.T) {
213 t.Parallel()

Callers

nothing calls this directly

Calls 3

serverVersionMessageFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected