mirror of
https://github.com/rclone/rclone.git
synced 2025-12-19 01:33:25 +00:00
vendor: update all dependencies
This commit is contained in:
20
vendor/github.com/spf13/cobra/bash_completions_test.go
generated
vendored
20
vendor/github.com/spf13/cobra/bash_completions_test.go
generated
vendored
@@ -2,16 +2,12 @@ package cobra
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var _ = fmt.Println
|
||||
var _ = os.Stderr
|
||||
|
||||
func checkOmit(t *testing.T, found, unexpected string) {
|
||||
if strings.Contains(found, unexpected) {
|
||||
t.Errorf("Unexpected response.\nGot: %q\nBut should not have!\n", unexpected)
|
||||
@@ -178,3 +174,19 @@ func TestBashCompletionDeprecatedFlag(t *testing.T) {
|
||||
t.Errorf("expected completion to not include %q flag: Got %v", flagName, bashCompletion)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkBashCompletion(b *testing.B) {
|
||||
c := initializeWithRootCmd()
|
||||
cmdEcho.AddCommand(cmdTimes)
|
||||
c.AddCommand(cmdEcho, cmdPrint, cmdDeprecated, cmdColon)
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
if err := c.GenBashCompletion(buf); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user