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

Function TestNoExtraFormatDirectives

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

Source from the content-addressed store, hash-verified

26}
27
28func TestNoExtraFormatDirectives(t *testing.T) {
29 buf := new(bytes.Buffer)
30 SetOutput(buf)
31 SetPrefix("foo", "bar")
32 Printkv(context.Background(), "baz", 1)
33 SetOutput(os.Stdout)
34 got := buf.String()
35 if strings.Contains(got, "%") {
36 t.Errorf("log line appears to contain format directive: %q", got)
37 }
38}
39
40func TestPrefix(t *testing.T) {
41 buf := new(bytes.Buffer)

Callers

nothing calls this directly

Calls 5

SetOutputFunction · 0.85
SetPrefixFunction · 0.85
PrintkvFunction · 0.85
ContainsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected