mirror of
https://github.com/spf13/cobra
synced 2025-05-05 21:07:24 +00:00
Update Bash completion tests
Prefixes the tested `__handle_filename_extension_flag` and `__handle_subdirs_in_dir_flag` functions with the command name.
This commit is contained in:
parent
fc5612606f
commit
46819c09f3
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ package cobra
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -146,11 +147,11 @@ func TestBashCompletions(t *testing.T) {
|
||||||
// check for filename extension flags
|
// check for filename extension flags
|
||||||
check(t, output, `must_have_one_noun+=("three")`)
|
check(t, output, `must_have_one_noun+=("three")`)
|
||||||
// check for filename extension flags
|
// check for filename extension flags
|
||||||
check(t, output, `flags_completion+=("__handle_filename_extension_flag json|yaml|yml")`)
|
check(t, output, fmt.Sprintf(`flags_completion+=("__%s_handle_filename_extension_flag json|yaml|yml")`, rootCmd.Name()))
|
||||||
// check for custom flags
|
// check for custom flags
|
||||||
check(t, output, `flags_completion+=("__complete_custom")`)
|
check(t, output, `flags_completion+=("__complete_custom")`)
|
||||||
// check for subdirs_in_dir flags
|
// check for subdirs_in_dir flags
|
||||||
check(t, output, `flags_completion+=("__handle_subdirs_in_dir_flag themes")`)
|
check(t, output, fmt.Sprintf(`flags_completion+=("__%s_handle_subdirs_in_dir_flag themes")`, rootCmd.Name()))
|
||||||
|
|
||||||
checkOmit(t, output, deprecatedCmd.Name())
|
checkOmit(t, output, deprecatedCmd.Name())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue