MCPcopy
hub / github.com/yuk7/wsldl / TestGetCommandWithNoArgsWithDeps_HelpVisibility

Function TestGetCommandWithNoArgsWithDeps_HelpVisibility

src/install/command_test.go:514–538  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

512}
513
514func TestGetCommandWithNoArgsWithDeps_HelpVisibility(t *testing.T) {
515 t.Parallel()
516
517 wsl := wsllib.MockWslLib{
518 IsDistributionRegisteredFunc: func(name string) bool {
519 return false
520 },
521 }
522 cmd := GetCommandWithNoArgsWithDeps(wsl, wsllib.MockWslReg{})
523 if cmd.Visible == nil {
524 t.Fatal("Visible is nil")
525 }
526 if !cmd.Visible("Arch") {
527 t.Fatal("Visible(Arch) = false, want true")
528 }
529 if cmd.HelpText == nil {
530 t.Fatal("HelpText is nil")
531 }
532 if got := cmd.HelpText(); got == "" {
533 t.Fatal("HelpText should not be empty")
534 }
535
536 err := cmd.Run("Arch", []string{"a", "b"})
537 assertDisplayError(t, err)
538}
539
540func TestGetCommandWithDeps_HelpVisibility(t *testing.T) {
541 t.Parallel()

Callers

nothing calls this directly

Calls 2

assertDisplayErrorFunction · 0.70

Tested by

no test coverage detected