do not clear error formatting informative field
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -125,4 +126,16 @@ func TestEntryWithIncorrectField(t *testing.T) {
|
||||
|
||||
assert.Equal(eWithFunc.err, `can not add field "func"`)
|
||||
assert.Equal(eWithFuncPtr.err, `can not add field "funcPtr"`)
|
||||
|
||||
eWithFunc = eWithFunc.WithField("not_a_func", "it is a string")
|
||||
eWithFuncPtr = eWithFuncPtr.WithField("not_a_func", "it is a string")
|
||||
|
||||
assert.Equal(eWithFunc.err, `can not add field "func"`)
|
||||
assert.Equal(eWithFuncPtr.err, `can not add field "funcPtr"`)
|
||||
|
||||
eWithFunc = eWithFunc.WithTime(time.Now())
|
||||
eWithFuncPtr = eWithFuncPtr.WithTime(time.Now())
|
||||
|
||||
assert.Equal(eWithFunc.err, `can not add field "func"`)
|
||||
assert.Equal(eWithFuncPtr.err, `can not add field "funcPtr"`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user