Skip to content

Commit

Permalink
✅ fix
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <kyukawa315@gmail.com>
  • Loading branch information
vankichi committed Aug 20, 2020
1 parent f78767c commit a18b6fb
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions internal/db/storage/blob/s3/reader/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ func TestWithMaxChunkSize(t *testing.T) {
maxChunkSize: 10,
},
},
checkFunc: defaultCheckFunc,
},
{
name: "set success when size is negative number",
Expand All @@ -345,14 +344,12 @@ func TestWithMaxChunkSize(t *testing.T) {
maxChunkSize: -10,
},
},
checkFunc: defaultCheckFunc,
},
{
name: "set success when size is zero",
want: want{
obj: new(T),
},
checkFunc: defaultCheckFunc,
},
}

Expand Down Expand Up @@ -412,14 +409,12 @@ func TestWithBackoff(t *testing.T) {
backoffEnabled: true,
},
},
checkFunc: defaultCheckFunc,
},
{
name: "set success when backoff enabled is false",
want: want{
obj: new(T),
},
checkFunc: defaultCheckFunc,
},
}

Expand Down Expand Up @@ -469,7 +464,10 @@ func TestWithBackoffOpts(t *testing.T) {
cmp.AllowUnexported(*got),
cmp.AllowUnexported(*w.obj),
cmp.Comparer(func(want, got []backoff.Option) bool {
return reflect.DeepEqual(want, got) || (got != nil && want != nil)
return len(got) == len(want)
}),
cmp.Comparer(func(want, got backoff.Option) bool {
return reflect.ValueOf(got).Pointer() == reflect.ValueOf(want).Pointer()
}),
}
if diff := cmp.Diff(w.obj, got, opts...); diff != "" {
Expand All @@ -492,7 +490,6 @@ func TestWithBackoffOpts(t *testing.T) {
backoffOpts: opts,
},
},
checkFunc: defaultCheckFunc,
}
}(),
func() test {
Expand All @@ -514,16 +511,16 @@ func TestWithBackoffOpts(t *testing.T) {
beforeFunc: func(args args, r *T) {
r.backoffOpts = args.defaultOpts
},
checkFunc: defaultCheckFunc,
}
}(),
{
name: "set success when opts is nil",
want: want{
obj: new(T),
},
checkFunc: defaultCheckFunc,
},
func() test {
return test{
name: "set success when opts is nil",
want: want{
obj: new(T),
},
}
}(),
}

for _, test := range tests {
Expand Down

0 comments on commit a18b6fb

Please sign in to comment.