(t *testing.T)
| 484 | } |
| 485 | |
| 486 | func TestParseExamplesFromLong_BasicBlock(t *testing.T) { |
| 487 | long := `Create a new item. |
| 488 | |
| 489 | Examples: |
| 490 | pad item create task "fix bug" --priority high |
| 491 | pad item create idea "feature x" |
| 492 | |
| 493 | Run with --help-collections to see available collections.` |
| 494 | |
| 495 | got := parseExamplesFromLong(long) |
| 496 | if len(got) != 2 { |
| 497 | t.Fatalf("expected 2 examples, got %d: %+v", len(got), got) |
| 498 | } |
| 499 | if got[0].Cmd != `pad item create task "fix bug" --priority high` { |
| 500 | t.Errorf("example[0] = %q", got[0].Cmd) |
| 501 | } |
| 502 | if got[1].Cmd != `pad item create idea "feature x"` { |
| 503 | t.Errorf("example[1] = %q", got[1].Cmd) |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | func TestParseExamplesFromLong_NoHeader(t *testing.T) { |
| 508 | long := `Generate shell completion scripts. |
nothing calls this directly
no test coverage detected