mirror of
https://github.com/spf13/viper
synced 2024-12-23 12:07:02 +00:00
18 lines
396 B
Go
18 lines
396 B
Go
|
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"))
|
||
|
}
|