Route help and version through the reporter
This commit is contained in:
@@ -36,7 +36,7 @@ func TestDiscoveryUsageRetainsEnteredPrefix(t *testing.T) {
|
||||
t.Run(prefix+"/"+test.name, func(t *testing.T) {
|
||||
var output, diagnostics bytes.Buffer
|
||||
outcome := app.Execute(context.Background(), append(strings.Fields(prefix), test.tail...), Streams{Out: &output, Err: &diagnostics})
|
||||
if outcome.Kind != OutcomeUsage || outcome.Status != 2 || outcome.DiagnosticDelivery != DeliveryComplete || output.Len() != 0 {
|
||||
if outcome.Kind != OutcomeUsage || outcome.Status != 2 || outcome.Presentation.Diagnostics.State != DeliveryComplete || output.Len() != 0 {
|
||||
t.Fatalf("outcome = %#v, output %q", outcome, output.String())
|
||||
}
|
||||
for _, fragment := range []string{test.want, "Usage: Demo " + prefix} {
|
||||
@@ -828,7 +828,7 @@ func TestAliasUsageSurvivesRegistrationDuringExecution(t *testing.T) {
|
||||
Name: "inspect",
|
||||
Run: func(Invocation, struct{}) Outcome {
|
||||
registrationErr = test.register(app)
|
||||
return Usage(errors.New("operation rejected"))
|
||||
return Usage("operation rejected").WithCause(errors.New("operation rejected"))
|
||||
},
|
||||
})
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user