(t *testing.T)
| 370 | } |
| 371 | |
| 372 | func TestUpdateCmd_UpdateProjectRepos_NoTargets(t *testing.T) { |
| 373 | // Cleanup. |
| 374 | dirs.RemoveAllForTest() |
| 375 | |
| 376 | // Check error. |
| 377 | var check = func(err error) { |
| 378 | t.Helper() |
| 379 | if err != nil { |
| 380 | t.Fatal(err) |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | // Init celer. |
| 385 | celer := configs.NewCeler() |
| 386 | check(celer.Init()) |
| 387 | check(celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true)) |
| 388 | check(celer.SetBuildType("Release")) |
| 389 | |
| 390 | // Create update command. |
| 391 | updateCmd := updateCmd{ |
| 392 | celer: celer, |
| 393 | } |
| 394 | |
| 395 | // Test updating ports with no targets. |
| 396 | err := updateCmd.updateProjectRepos([]string{}) |
| 397 | if err == nil { |
| 398 | t.Fatal("updatePorts should return error when no targets specified") |
| 399 | } |
| 400 | if !strings.Contains(err.Error(), "no ports specified") { |
| 401 | t.Errorf("Expected 'no ports specified' error, got: %v", err) |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | func TestUpdateCmd_UpdatePortRepo_SrcNotExist(t *testing.T) { |
| 406 | // Cleanup. |
nothing calls this directly
no test coverage detected