MCPcopy
hub / github.com/op/go-logging / TestVarFuncFormat

Function TestVarFuncFormat

format_test.go:70–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestVarFuncFormat(t *testing.T) {
71 backend := InitForTesting(DEBUG)
72 SetFormatter(MustStringFormatter("%{shortfunc}"))
73
74 var varFunc = func() string {
75 return logAndGetLine(backend)
76 }
77
78 line := varFunc()
79 if "???" == line || "TestVarFuncFormat" == line || "varFunc" == line {
80 t.Errorf("Unexpected format: %s", line)
81 }
82}
83
84func TestFormatFuncName(t *testing.T) {
85 var tests = []struct {

Callers

nothing calls this directly

Calls 5

InitForTestingFunction · 0.85
SetFormatterFunction · 0.85
MustStringFormatterFunction · 0.85
logAndGetLineFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected