Skip to content

Commit 0964bb6

Browse files
committed
test(cli): describe unknown subcommand case technically
1 parent 996987e commit 0964bb6

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

internal/cli/group_test.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,10 @@ func TestCommandUnknownSubcommandFailsLoudly(t *testing.T) {
4343
}
4444
}
4545

46-
// TestCommandUnknownSubcommandReportedFromAudit reproduces the exact repro
47-
// from the production audit: an AI-SRE session guessed "incident
48-
// list-alerts" instead of the real "incident alerts" subcommand. The typo is
49-
// too far (by both edit-distance and prefix) from any real subcommand name
50-
// for cobra's SuggestionsFor to produce a match, so this only asserts the
51-
// core fix — non-zero exit, clearly-labeled unknown command — not a
52-
// suggestion. See TestCommandUnknownSubcommandFailsLoudly for the
53-
// suggestion-bearing case.
54-
func TestCommandUnknownSubcommandReportedFromAudit(t *testing.T) {
46+
// TestCommandUnknownSubcommandWithoutSuggestionFails verifies that an unknown
47+
// subcommand still returns an error when it is too far from every real
48+
// subcommand for cobra to suggest a match.
49+
func TestCommandUnknownSubcommandWithoutSuggestionFails(t *testing.T) {
5550
saveAndResetGlobals(t)
5651

5752
_, err := execCommand("incident", "list-alerts")

0 commit comments

Comments
 (0)