(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func TestLoadProject_Compatibility(t *testing.T) { |
| 261 | tmpDir := t.TempDir() |
| 262 | composeFile := filepath.Join(tmpDir, "compose.yaml") |
| 263 | composeContent := ` |
| 264 | services: |
| 265 | web: |
| 266 | image: nginx:latest |
| 267 | ` |
| 268 | err := os.WriteFile(composeFile, []byte(composeContent), 0o644) |
| 269 | assert.NilError(t, err) |
| 270 | |
| 271 | service, err := NewComposeService(nil) |
| 272 | assert.NilError(t, err) |
| 273 | |
| 274 | // With compatibility mode |
| 275 | project, err := service.LoadProject(t.Context(), api.ProjectLoadOptions{ |
| 276 | ConfigPaths: []string{composeFile}, |
| 277 | Compatibility: true, |
| 278 | }) |
| 279 | |
| 280 | assert.NilError(t, err) |
| 281 | assert.Assert(t, project != nil) |
| 282 | // In compatibility mode, separator should be "_" |
| 283 | assert.Equal(t, "_", api.Separator) |
| 284 | |
| 285 | // Reset separator |
| 286 | api.Separator = "-" |
| 287 | } |
| 288 | |
| 289 | func TestLoadProject_InvalidComposeFile(t *testing.T) { |
| 290 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected