Skip to content
Myr

Test confirming fixed #11

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by spf13 · committed by spf13 · parent 1a6c5d1 · Browse files · 1 file+18 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−0 removed

  • other:+18 added−0 removed

1 file+18 added−0 removed

modified:cobra_test.go+18 added
333 unmodified lines
334335 if !strings.Contains(buf.String(), "intone=123") {336 t.Errorf("Wrong error message displayed, \n %s", buf.String())337 }338339 // Testing flag with invalid input340 buf.Reset()341 c = initialize()342 c.SetOutput(buf)343 cmdEcho.AddCommand(cmdTimes)344 c.AddCommand(cmdPrint, cmdEcho)345 c.SetArgs(strings.Split("echo -i10E", " "))346 err = c.Execute()347348 if err == nil {349 t.Errorf("invalid input should generate error")350 }351352 if !strings.Contains(buf.String(), "invalid argument \"10E\" for -i10E") {353 t.Errorf("Wrong error message displayed, \n %s", buf.String())354 }355356}357358func TestTrailingCommandFlags(t *testing.T) {359 buf := new(bytes.Buffer)
100 unmodified lines