MCPcopy Index your code
hub / github.com/celer-pkg/celer / TestRemoveCmd_Recursive

Function TestRemoveCmd_Recursive

cmds/cmd_remove_test.go:515–537  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

513}
514
515func 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
539func installForTestRemove(t *testing.T, nameVersion string, option configs.RemoveOptions) configs.Port {
540 // Check error.

Callers

nothing calls this directly

Calls 3

InstalledMethod · 0.95
InitMethod · 0.95
installForTestRemoveFunction · 0.85

Tested by

no test coverage detected