From 02da13fb18985df4d447368fd68f7563fbc83040 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 13 Oct 2024 17:54:40 +0200 Subject: [PATCH] completion: add test for NoComplete Signed-off-by: Sebastiaan van Stijn (cherry picked from commit be197da6b848c4f3efbaf6bcdde5f50868acbb6c) Signed-off-by: Sebastiaan van Stijn --- cli/command/completion/functions_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/command/completion/functions_test.go b/cli/command/completion/functions_test.go index 7a98e2d3c9..f522753930 100644 --- a/cli/command/completion/functions_test.go +++ b/cli/command/completion/functions_test.go @@ -37,6 +37,12 @@ func TestCompleteFromList(t *testing.T) { assert.Check(t, is.DeepEqual(values, expected)) } +func TestCompleteNoComplete(t *testing.T) { + values, directives := NoComplete(nil, nil, "") + assert.Check(t, is.Equal(directives, cobra.ShellCompDirectiveNoFileComp)) + assert.Check(t, is.Len(values, 0)) +} + func TestCompletePlatforms(t *testing.T) { values, directives := Platforms(nil, nil, "") assert.Check(t, is.Equal(directives&cobra.ShellCompDirectiveNoFileComp, cobra.ShellCompDirectiveNoFileComp), "Should not perform file completion")