Allow early missing-selector failures in validation tests
This commit is contained in:
@@ -273,15 +273,12 @@ func TestValidationCommandUsageAndInputFailuresStopProviderWork(t *testing.T) {
|
||||
},
|
||||
}
|
||||
outcome := newPromptTestApp(t, Command(suite)).Execute(context.Background(), test.args, commandkit.Streams{Out: io.Discard, Err: io.Discard})
|
||||
wantInputCalls := 0
|
||||
if test.name == "missing required selector" {
|
||||
// prepareSuiteInput initializes the caller input before core validates
|
||||
// captured required bindings; CheckInput and provider work still stop.
|
||||
wantInputCalls = 1
|
||||
}
|
||||
if outcome.Kind != commandkit.OutcomeUsage || outcome.Status != 2 || newInputCalls != wantInputCalls || checkCalls != 0 || newStateCalls != 0 || providerCalls != 0 {
|
||||
if outcome.Kind != commandkit.OutcomeUsage || outcome.Status != 2 || checkCalls != 0 || newStateCalls != 0 || providerCalls != 0 {
|
||||
t.Fatalf("preflight failure = %#v, input/check/state/provider=%d/%d/%d/%d", outcome, newInputCalls, checkCalls, newStateCalls, providerCalls)
|
||||
}
|
||||
if test.name != "missing required selector" && newInputCalls != 0 {
|
||||
t.Fatalf("syntax or format failure invoked input factory %d times", newInputCalls)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user