(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func 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 |
nothing calls this directly
no test coverage detected