Skip to content

Commit

Permalink
Merge pull request #13 from yzwdroid/add-test
Browse files Browse the repository at this point in the history
add remove duplicate test
  • Loading branch information
IsabellaDev authored Nov 30, 2020
2 parents f002157 + 50e8344 commit 823d66d
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 823d66d

Please sign in to comment.