(t *testing.T)
| 170 | } |
| 171 | |
| 172 | func 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 | |
| 185 | func TestCompleteFileNames(t *testing.T) { |
| 186 | values, directives := FileNames()(nil, nil, "") |
nothing calls this directly
no test coverage detected
searching dependent graphs…