(t *testing.T)
| 1136 | } |
| 1137 | |
| 1138 | func TestCommand_CommandWithDash(t *testing.T) { |
| 1139 | var args Args |
| 1140 | |
| 1141 | cmd := &Command{ |
| 1142 | Commands: []*Command{ |
| 1143 | { |
| 1144 | Name: "cmd", |
| 1145 | Action: func(_ context.Context, cmd *Command) error { |
| 1146 | args = cmd.Args() |
| 1147 | return nil |
| 1148 | }, |
| 1149 | }, |
| 1150 | }, |
| 1151 | } |
| 1152 | |
| 1153 | require.NoError(t, cmd.Run(buildTestContext(t), []string{"", "cmd", "my-arg", "-"})) |
| 1154 | require.NotNil(t, args) |
| 1155 | require.Equal(t, "my-arg", args.Get(0)) |
| 1156 | require.Equal(t, "-", args.Get(1)) |
| 1157 | } |
| 1158 | |
| 1159 | func TestCommand_CommandWithNoFlagBeforeTerminator(t *testing.T) { |
| 1160 | var args Args |
nothing calls this directly
no test coverage detected