Allow early missing-selector failures in validation tests

This commit is contained in:
2026-10-12 23:42:18 +00:00
parent 99e2089e75
commit 775c32479d
2 changed files with 14 additions and 9 deletions

View File

@@ -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)
}
})
}