Simplify bash_completions.go

Improve test coverage from 80% to 85%.
This commit is contained in:
Albert Nigmatzianov
2017-05-14 13:20:20 +02:00
parent 4cdb38c072
commit de6b168d98
2 changed files with 78 additions and 193 deletions

View File

@ -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)