forked from kemsta/go-easyrsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors_test.go
61 lines (58 loc) · 973 Bytes
/
errors_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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package easyrsa
import (
"reflect"
"testing"
)
func TestNewNotExist(t *testing.T) {
type args struct {
err string
}
tests := []struct {
name string
args args
want *NotExist
}{
{
name: "just create",
args: args{
err: "msg",
},
want: &NotExist{"msg"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := NewNotExist(tt.args.err); !reflect.DeepEqual(got, tt.want) {
t.Errorf("NewNotExist() = %v, want %v", got, tt.want)
}
})
}
}
func TestNotExist_Error(t *testing.T) {
type fields struct {
err string
}
tests := []struct {
name string
fields fields
want string
}{
{
name: "msg",
fields: fields{
err: "msg",
},
want: "msg",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
e := &NotExist{
err: tt.fields.err,
}
if got := e.Error(); got != tt.want {
t.Errorf("NotExist.Error() = %v, want %v", got, tt.want)
}
})
}
}