spf13--viper/internal/encoding/error_test.go

18 lines
396 B
Go
Raw Normal View History

package encoding
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_encodingError(t *testing.T) {
err1 := fmt.Errorf("test error")
err2 := encodingError("encoding error")
assert.NotErrorIs(t, err1, err2)
assert.NotErrorIs(t, err2, err1)
assert.ErrorIs(t, err2, encodingError("encoding error"))
assert.NotErrorIs(t, err2, encodingError("other encodingerror"))
}