Skip to content

Commit

Permalink
add remove duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
yzwdroid committed Nov 29, 2020
1 parent f002157 commit 50e8344
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,26 @@ func Test404GetStatusCode(t *testing.T) {
t.Errorf("Expected: %v, but got: %v", expected, result)
}
}

func Test_removeDuplicate(t *testing.T) {
type args struct {
urls []string
}
tests := []struct {
name string
args args
want []string
}{
// TODO: Add test cases.
{"name", args{[]string{"http://www.google.ca", "http://www.google.ca"}}, []string{"http://www.google.ca"}},
{"name", args{[]string{"http://www.google.ca", "http://zyang.ca", "http://www.google.ca"}}, []string{"http://www.google.ca", "http://zyang.ca"}},
{"name", args{[]string{}}, []string{}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := removeDuplicate(tt.args.urls); !reflect.DeepEqual(got, tt.want) {
t.Errorf("removeDuplicate() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit 50e8344

Please sign in to comment.