MCPcopy Index your code
hub / github.com/docker/cli / TestUpdateEnvironmentWithDuplicateValues

Function TestUpdateEnvironmentWithDuplicateValues

cli/command/service/update_test.go:149–160  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestUpdateEnvironmentWithDuplicateValues(t *testing.T) {
150 flags := newUpdateCommand(nil).Flags()
151 flags.Set("env-rm", "foo")
152 flags.Set("env-add", "foo=first")
153 flags.Set("env-add", "foo=second")
154
155 envs := []string{"foo=value"}
156
157 updateEnvironment(flags, &envs)
158 assert.Check(t, is.Len(envs, 1))
159 assert.Equal(t, envs[0], "foo=second")
160}
161
162func TestUpdateEnvironmentWithDuplicateKeys(t *testing.T) {
163 // Test case for #25404

Callers

nothing calls this directly

Calls 4

newUpdateCommandFunction · 0.70
updateEnvironmentFunction · 0.70
SetMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…