MCPcopy Create free account
hub / github.com/github/gh-aw / TestNewViewCommand_RequiresExactlyOneArg

Function TestNewViewCommand_RequiresExactlyOneArg

pkg/cli/view_command_test.go:40–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestNewViewCommand_RequiresExactlyOneArg(t *testing.T) {
41 cmd := NewViewCommand()
42 // No args → error
43 if err := cmd.Args(cmd, []string{}); err == nil {
44 t.Error("expected error for zero arguments")
45 }
46 // One arg → ok
47 if err := cmd.Args(cmd, []string{"1234567890"}); err != nil {
48 t.Errorf("expected no error for one argument, got: %v", err)
49 }
50 // Two args → error
51 if err := cmd.Args(cmd, []string{"1", "2"}); err == nil {
52 t.Error("expected error for two arguments")
53 }
54}
55
56// ─── buildRunHTMLURL ──────────────────────────────────────────────────────────
57

Callers

nothing calls this directly

Calls 3

NewViewCommandFunction · 0.85
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected