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

Function TestCompleteEnvVarNames

cli/command/completion/functions_test.go:172–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

170}
171
172func TestCompleteEnvVarNames(t *testing.T) {
173 env.PatchAll(t, map[string]string{
174 "ENV_A": "hello-a",
175 "ENV_B": "hello-b",
176 })
177 values, directives := EnvVarNames()(nil, nil, "")
178 assert.Check(t, is.Equal(directives&cobra.ShellCompDirectiveNoFileComp, cobra.ShellCompDirectiveNoFileComp), "Should not perform file completion")
179
180 sort.Strings(values)
181 expected := []string{"ENV_A", "ENV_B"}
182 assert.Check(t, is.DeepEqual(values, expected))
183}
184
185func TestCompleteFileNames(t *testing.T) {
186 values, directives := FileNames()(nil, nil, "")

Callers

nothing calls this directly

Calls 1

EnvVarNamesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…