MCPcopy
hub / github.com/uber-go/zap / TestNewEncoder

Function TestNewEncoder

encoder_test.go:53–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestNewEncoder(t *testing.T) {
54 testEncoders(func() {
55 assert.NoError(t, RegisterEncoder("foo", newNilEncoder), "expected to be able to register the encoder foo")
56 encoder, err := newEncoder("foo", zapcore.EncoderConfig{})
57 assert.NoError(t, err, "could not create an encoder for the registered name foo")
58 assert.Nil(t, encoder, "the encoder from newNilEncoder is not nil")
59 })
60}
61
62func TestNewEncoderNotRegistered(t *testing.T) {
63 _, err := newEncoder("foo", zapcore.EncoderConfig{})

Callers

nothing calls this directly

Calls 3

testEncodersFunction · 0.85
RegisterEncoderFunction · 0.85
newEncoderFunction · 0.85

Tested by

no test coverage detected