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

Function TestPrefix

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

Source from the content-addressed store, hash-verified

38}
39
40func TestPrefix(t *testing.T) {
41 buf := new(bytes.Buffer)
42 SetOutput(buf)
43 SetPrefix("foo", "bar")
44 Printkv(context.Background(), "baz", 1)
45 SetOutput(os.Stdout)
46
47 got := buf.String()
48 wantPrefix := "at=log_test.go:44 foo=bar "
49 if !strings.HasPrefix(got, wantPrefix) {
50 t.Errorf("output = %q want prefix %q", got, wantPrefix)
51 }
52
53 SetPrefix()
54 if procPrefix != nil {
55 t.Errorf("procPrefix = %q want nil", procPrefix)
56 }
57}
58
59func TestAddPrefixkv0(t *testing.T) {
60 got := prefix(context.Background())

Callers

nothing calls this directly

Calls 4

SetOutputFunction · 0.85
SetPrefixFunction · 0.85
PrintkvFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected