(t *testing.T)
| 513 | } |
| 514 | |
| 515 | func TestRemoveCmd_Recursive(t *testing.T) { |
| 516 | installedPort := installForTestRemove(t, "glog@0.6.0", configs.RemoveOptions{ |
| 517 | Recursive: true, |
| 518 | }) |
| 519 | |
| 520 | // Check if still installed. |
| 521 | if installed, err := installedPort.Installed(); err != nil { |
| 522 | t.Fatalf("failed to check installation status of glog@0.6.0: %v", err) |
| 523 | } else if installed { |
| 524 | t.Fatal("glog@0.6.0 should have been removed") |
| 525 | } |
| 526 | |
| 527 | // Check if dependency gflags@2.2.2 is also removed. |
| 528 | gflagsPort := configs.Port{} |
| 529 | if err := gflagsPort.Init(installedPort.MatchedConfig.Ctx, "gflags@2.2.2"); err != nil { |
| 530 | t.Fatalf("failed to initialize gflags@2.2.2 port: %v", err) |
| 531 | } |
| 532 | if installed, err := gflagsPort.Installed(); err != nil { |
| 533 | t.Fatalf("failed to check installation status of gflags@2.2.2: %v", err) |
| 534 | } else if installed { |
| 535 | t.Fatal("gflags@2.2.2 should have been removed") |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | func installForTestRemove(t *testing.T, nameVersion string, option configs.RemoveOptions) configs.Port { |
| 540 | // Check error. |
nothing calls this directly
no test coverage detected