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

Function TestIsRCVersion

buildinfo/buildinfo_test.go:106–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestIsRCVersion(t *testing.T) {
107 t.Parallel()
108
109 cases := []struct {
110 name string
111 version string
112 expected bool
113 }{
114 {"RC0", "v2.31.0-rc.0", true},
115 {"RC1WithBuild", "v2.31.0-rc.1+abc123", true},
116 {"RC10", "v2.31.0-rc.10", true},
117 {"RCDevel", "v2.33.0-rc.1-devel+727ec00f7", true},
118 {"DevelVersion", "v2.31.0-devel+abc123", false},
119 {"StableVersion", "v2.31.0", false},
120 {"DevNoVersion", "v0.0.0-devel+abc123", false},
121 {"BetaVersion", "v2.31.0-beta.1", false},
122 }
123
124 for _, c := range cases {
125 t.Run(c.name, func(t *testing.T) {
126 t.Parallel()
127 require.Equal(t, c.expected, buildinfo.IsRCVersion(c.version))
128 })
129 }
130}

Callers

nothing calls this directly

Calls 3

IsRCVersionFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected