-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_test.go
44 lines (39 loc) · 1006 Bytes
/
error_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package paramex
import (
"errors"
"testing"
)
func Test_Errors(t *testing.T) {
t.Run(`test_ErrorUnSupportedParamType`, func(t *testing.T) {
err := ErrorUnSupportedParamType{
errors.New(`test error`),
}
if err.Error() != `test error` {
t.Errorf(`expexted "test error", received "%v"`, err.Error())
}
})
t.Run(`test_ErrorUnmarshalType`, func(t *testing.T) {
err := ErrorUnmarshalType{
errors.New(`test error`),
}
if err.Error() != `test error` {
t.Errorf(`expexted "test error", received "%v"`, err.Error())
}
})
t.Run(`test_ErrorNotAssignable`, func(t *testing.T) {
err := ErrorNotAssignable{
errors.New(`test error`),
}
if err.Error() != `test error` {
t.Errorf(`expexted "test error", received "%v"`, err.Error())
}
})
t.Run(`test_ErrorUnSupportedType`, func(t *testing.T) {
err := ErrorUnSupportedType{
errors.New(`test error`),
}
if err.Error() != `test error` {
t.Errorf(`expexted "test error", received "%v"`, err.Error())
}
})
}