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

Function TestMapObjectEncoderReflectionFailures

zapcore/memory_encoder_test.go:361–370  ·  zapcore/memory_encoder_test.go::TestMapObjectEncoderReflectionFailures
(t *testing.T)

Source from the content-addressed store, hash-verified

359}
360
361func TestMapObjectEncoderReflectionFailures(t *testing.T) {
362 enc := NewMapObjectEncoder()
363 assert.Error(t, enc.AddObject("object", loggable{false}), "Expected AddObject to fail.")
364 assert.Equal(
365 t,
366 map[string]interface{}{"object": map[string]interface{}{}},
367 enc.Fields,
368 "Expected encoder to use empty values on errors.",
369 )
370}

Callers

nothing calls this directly

Calls 3

AddObjectMethod · 0.95
NewMapObjectEncoderFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected