Checking in vendor folder for ease of using go get.
This commit is contained in:
parent
7a1251853b
commit
cdb4b5a1d0
3554 changed files with 1270116 additions and 0 deletions
22
vendor/github.com/spf13/cobra/cobra_test.go
generated
vendored
Normal file
22
vendor/github.com/spf13/cobra/cobra_test.go
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
package cobra
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
func TestAddTemplateFunctions(t *testing.T) {
|
||||
AddTemplateFunc("t", func() bool { return true })
|
||||
AddTemplateFuncs(template.FuncMap{
|
||||
"f": func() bool { return false },
|
||||
"h": func() string { return "Hello," },
|
||||
"w": func() string { return "world." }})
|
||||
|
||||
c := &Command{}
|
||||
c.SetUsageTemplate(`{{if t}}{{h}}{{end}}{{if f}}{{h}}{{end}} {{w}}`)
|
||||
|
||||
const expected = "Hello, world."
|
||||
if got := c.UsageString(); got != expected {
|
||||
t.Errorf("Expected UsageString: %v\nGot: %v", expected, got)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue