From a5ca5b33f11eb19111a29c425c9a75f50c1aefd5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 13 Oct 2024 17:52:50 +0200 Subject: [PATCH] completion: add test for FileNames 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 817aef27a6..d915ccdc36 100644 --- a/cli/command/completion/functions_test.go +++ b/cli/command/completion/functions_test.go @@ -23,6 +23,12 @@ func TestCompleteEnvVarNames(t *testing.T) { assert.Check(t, is.DeepEqual(values, expected)) } +func TestCompleteFileNames(t *testing.T) { + values, directives := FileNames(nil, nil, "") + assert.Check(t, is.Equal(directives, cobra.ShellCompDirectiveDefault)) + 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")