MCPcopy
hub / github.com/spf13/pflag / TestSetOutput

Function TestSetOutput

flag_test.go:962–971  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

960}
961
962func TestSetOutput(t *testing.T) {
963 var flags FlagSet
964 var buf bytes.Buffer
965 flags.SetOutput(&buf)
966 flags.Init("test", ContinueOnError)
967 flags.Parse([]string{"--unknown"})
968 if out := buf.String(); !strings.Contains(out, "--unknown") {
969 t.Logf("expected output mentioning unknown; got %q", out)
970 }
971}
972
973func TestOutput(t *testing.T) {
974 var flags FlagSet

Callers

nothing calls this directly

Calls 4

SetOutputMethod · 0.95
InitMethod · 0.95
ParseMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected