Release v1.0.0 #2
@ -33,6 +33,32 @@ func Test_StoneWrap(t *testing.T) {
|
|||||||
t.Log(stoneError)
|
t.Log(stoneError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_NormalUnwrap(t *testing.T) {
|
||||||
|
normalError := errors.New("test")
|
||||||
|
stoneError := Wrap(normalError, 1, "test")
|
||||||
|
|
||||||
|
unwrap := stoneError.Unwrap()
|
||||||
|
|
||||||
|
if IsStoneError(unwrap) {
|
||||||
|
t.Fail()
|
||||||
|
} else {
|
||||||
|
t.Log(stoneError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func Test_StoneUnwrap(t *testing.T) {
|
||||||
|
normalError := New(1, "test")
|
||||||
|
stoneError := Wrap(normalError, 1, "test")
|
||||||
|
|
||||||
|
unwrap := stoneError.Unwrap()
|
||||||
|
|
||||||
|
if !IsStoneError(unwrap) {
|
||||||
|
t.Fail()
|
||||||
|
} else {
|
||||||
|
t.Log(stoneError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func Test_ToJSON(t *testing.T) {
|
func Test_ToJSON(t *testing.T) {
|
||||||
stoneError := New(1, "test").
|
stoneError := New(1, "test").
|
||||||
WithMetadata("key", "value").
|
WithMetadata("key", "value").
|
||||||
|
Loading…
x
Reference in New Issue
Block a user