(t *testing.T)
| 250 | } |
| 251 | |
| 252 | func TestResolveAppID_ShortCircuitsOnFlag(t *testing.T) { |
| 253 | tests := []struct { |
| 254 | name string |
| 255 | flags map[string]string |
| 256 | }{ |
| 257 | {name: "long --project-name", flags: map[string]string{"project-name": ""}}, |
| 258 | {name: "short -p", flags: map[string]string{"p": ""}}, |
| 259 | {name: "long --file", flags: map[string]string{"file": ""}}, |
| 260 | {name: "short -f", flags: map[string]string{"f": ""}}, |
| 261 | {name: "long --project-directory", flags: map[string]string{"project-directory": ""}}, |
| 262 | {name: "deprecated --workdir alias", flags: map[string]string{"workdir": ""}}, |
| 263 | {name: "long --env-file", flags: map[string]string{"env-file": ""}}, |
| 264 | } |
| 265 | for _, tt := range tests { |
| 266 | t.Run(tt.name, func(t *testing.T) { |
| 267 | // Use a real tmpdir as workDir so the short-circuit path is |
| 268 | // exercised independently of the loader's file discovery. |
| 269 | got := resolveAppIDIn(t.Context(), tt.flags, t.TempDir()) |
| 270 | assert.Equal(t, got, "") |
| 271 | }) |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | func TestResolveAppID_NameFromComposeFile(t *testing.T) { |
| 276 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected