MCPcopy Create free account
hub / github.com/docker/docker-agent / TestExtractVersionPrefix

Function TestExtractVersionPrefix

pkg/toolinstall/resolver_test.go:178–198  ·  view source on GitHub ↗

--- extractVersionPrefix tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

176// --- extractVersionPrefix tests ---
177
178func TestExtractVersionPrefix(t *testing.T) {
179 t.Parallel()
180
181 tests := []struct {
182 filter string
183 want string
184 }{
185 {`Version startsWith "gopls/"`, "gopls/"},
186 {`Version startsWith 'cmd/'`, "cmd/"},
187 {"", ""},
188 {`Version contains "v1"`, ""},
189 {` Version startsWith "tools/" `, "tools/"},
190 }
191
192 for _, tt := range tests {
193 t.Run(tt.filter, func(t *testing.T) {
194 t.Parallel()
195 assert.Equal(t, tt.want, extractVersionPrefix(tt.filter))
196 })
197 }
198}

Callers

nothing calls this directly

Calls 2

extractVersionPrefixFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected