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

Function TestDuplicateRegisterEncoder

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

Source from the content-addressed store, hash-verified

40}
41
42func TestDuplicateRegisterEncoder(t *testing.T) {
43 testEncoders(func() {
44 assert.NoError(t, RegisterEncoder("foo", newNilEncoder), "expected to be able to register the encoder foo")
45 assert.Error(t, RegisterEncoder("foo", newNilEncoder), "expected an error when registering an encoder with the same name twice")
46 })
47}
48
49func TestRegisterEncoderNoName(t *testing.T) {
50 assert.Equal(t, errNoEncoderNameSpecified, RegisterEncoder("", newNilEncoder), "expected an error when registering an encoder with no name")

Callers

nothing calls this directly

Calls 3

testEncodersFunction · 0.85
RegisterEncoderFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected