-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
40 lines (38 loc) · 828 Bytes
/
main_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
package main
import (
"reflect"
"testing"
)
func Test_reAdjustURLs(t *testing.T) {
type args struct {
urls []string
}
tests := []struct {
name string
args args
want []string
}{
{
name: "simple_urls_test",
args: args{
urls: []string{"abc.com", "http://pqrst.xxx", "ddd.com"},
},
want: []string{"http://abc.com", "http://pqrst.xxx", "http://ddd.com"},
},
{
name: "simple_urls_test",
args: args{
urls: []string{"abc.com", "http://pqrst.xxx", "https://ddd.com"},
},
want: []string{"http://abc.com", "http://pqrst.xxx", "https://ddd.com"},
},
}
for _, test := range tests {
tt := test
t.Run(tt.name, func(t *testing.T) {
if got := reAdjustURLs(tt.args.urls); !reflect.DeepEqual(got, tt.want) {
t.Errorf("readjustURLs() = %v, want %v", got, tt.want)
}
})
}
}