(t *testing.T)
| 205 | } |
| 206 | |
| 207 | func TestUnknownSubcommandRunE_NoArgsShowsHelp(t *testing.T) { |
| 208 | _, drive, _ := newGroupTree() |
| 209 | installUnknownSubcommandGuard(drive.Root()) |
| 210 | |
| 211 | var buf bytes.Buffer |
| 212 | drive.SetOut(&buf) |
| 213 | drive.SetErr(&buf) |
| 214 | |
| 215 | if err := drive.RunE(drive, nil); err != nil { |
| 216 | t.Fatalf("expected no-args invocation to succeed, got: %v", err) |
| 217 | } |
| 218 | if !strings.Contains(buf.String(), "drive ops") { |
| 219 | t.Errorf("expected help output to include the command's Short, got:\n%s", buf.String()) |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | func TestUnknownSubcommandRunE_UnknownReturnsStructuredError(t *testing.T) { |
| 224 | _, drive, _ := newGroupTree() |
nothing calls this directly
no test coverage detected