Skip to content
Myr

Add tests

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

authored by Alessio Treglia · committed by Steve Francia · parent cb27ce1 · Browse files · 1 file+24 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+24 added−0 removed

  • other:+24 added−0 removed

1 file+24 added−0 removed

modified:command_test.go+24 added
1379 unmodified lines
1380 t.Errorf("Expected setting output to nil to revert back to stdout")1381 }1382}13831384func TestSetOut(t *testing.T) {1385 c := &Command{}1386 c.SetOut(nil)1387 if out := c.OutOrStdout(); out != os.Stdout {1388 t.Errorf("Expected setting output to nil to revert back to stdout")1389 }1390}13911392func TestSetErr(t *testing.T) {1393 c := &Command{}1394 c.SetErr(nil)1395 if out := c.ErrOrStderr(); out != os.Stderr {1396 t.Errorf("Expected setting error to nil to revert back to stderr")1397 }1398}13991400func TestSetIn(t *testing.T) {1401 c := &Command{}1402 c.SetIn(nil)1403 if out := c.InOrStdin(); out != os.Stdin {1404 t.Errorf("Expected setting input to nil to revert back to stdin")1405 }1406}14071408func TestFlagErrorFunc(t *testing.T) {1409 c := &Command{Use: "c", Run: emptyRun}14101411 expectedFmt := "This is expected: %v"
348 unmodified lines