MCPcopy Create free account
hub / github.com/chain/txvm / TestSetOutput

Function TestSetOutput

log/log_test.go:16–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func 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
28func TestNoExtraFormatDirectives(t *testing.T) {
29 buf := new(bytes.Buffer)

Callers

nothing calls this directly

Calls 4

SetOutputFunction · 0.85
PrintfFunction · 0.85
ContainsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected