(t *testing.T)
| 766 | } |
| 767 | |
| 768 | func TestCommand_Run(t *testing.T) { |
| 769 | s := "" |
| 770 | |
| 771 | cmd := &Command{ |
| 772 | Action: func(_ context.Context, cmd *Command) error { |
| 773 | s = s + cmd.Args().First() |
| 774 | return nil |
| 775 | }, |
| 776 | } |
| 777 | |
| 778 | err := cmd.Run(buildTestContext(t), []string{"command", "foo"}) |
| 779 | assert.NoError(t, err) |
| 780 | err = cmd.Run(buildTestContext(t), []string{"command", "bar"}) |
| 781 | assert.NoError(t, err) |
| 782 | assert.Equal(t, s, "foobar") |
| 783 | } |
| 784 | |
| 785 | var commandTests = []struct { |
| 786 | name string |
nothing calls this directly
no test coverage detected