(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestSetOutput(t *testing.T) { |
| 17 | var buf bytes.Buffer |
| 18 | want := "foobar" |
| 19 | SetOutput(&buf) |
| 20 | Printf(context.Background(), want) |
| 21 | SetOutput(os.Stdout) |
| 22 | got := buf.String() |
| 23 | if !strings.Contains(got, want) { |
| 24 | t.Errorf("log = %q; should contain %q", got, want) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func TestNoExtraFormatDirectives(t *testing.T) { |
| 29 | buf := new(bytes.Buffer) |