-
Notifications
You must be signed in to change notification settings - Fork 0
/
birthday_test.go
51 lines (49 loc) · 943 Bytes
/
birthday_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
package hackerrank
import "testing"
func Test_birthday(t *testing.T) {
type args struct {
s []int32
d int32
m int32
}
tests := []struct {
name string
args args
want int32
}{
{
name: "",
args: args{
s: []int32{1, 2, 1, 3, 2},
d: 3,
m: 2,
},
want: 2,
},
{
name: "",
args: args{
s: []int32{4},
d: 4,
m: 1,
},
want: 1,
},
{
name: "",
args: args{
s: []int32{2, 3, 4, 4, 2, 1, 2, 5, 3, 4, 4, 3, 4, 1, 3, 5, 4, 5, 3, 1, 1, 5, 4, 3, 5, 3, 5, 3, 4, 4, 2, 4, 5, 2, 3, 2, 5, 3, 4, 2, 4, 3, 3, 4, 3, 5, 2, 5, 1, 3, 1, 4, 2, 2, 4, 3, 3, 3, 3, 4, 1, 1, 4, 3, 1, 5, 2, 5, 1, 3, 5, 4, 3, 3, 1, 5, 3, 3, 3, 4, 5, 2},
d: 26,
m: 8,
},
want: 16,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := birthday(tt.args.s, tt.args.d, tt.args.m); got != tt.want {
t.Errorf("birthday() = %v, want %v", got, tt.want)
}
})
}
}