Fix tests

This commit is contained in:
Shelikhoo committed 2020-06-08 16:16:50 +08:00
1 parent 09b81b78c3
commit 00103d1f73
3 files changed
+8 -5

No files matched your search

+3 -2
View File
@@ -54,7 +54,7 @@ func TestGetStats(t *testing.T) {
}
} else {
common.Must(err)
if r := cmp.Diff(resp.Stat, &Stat{Name: tc.name, Value: tc.value}); r != "" {
if r := cmp.Diff(resp.Stat, &Stat{Name: tc.name, Value: tc.value}, cmpopts.IgnoreUnexported(Stat{})); r != "" {
t.Error(r)
}
}
@@ -85,7 +85,8 @@ func TestQueryStats(t *testing.T) {
if r := cmp.Diff(resp.Stat, []*Stat{
{Name: "test_counter_2", Value: 2},
{Name: "test_counter_3", Value: 3},
}, cmpopts.SortSlices(func(s1, s2 *Stat) bool { return s1.Name < s2.Name })); r != "" {
}, cmpopts.SortSlices(func(s1, s2 *Stat) bool { return s1.Name < s2.Name }),
cmpopts.IgnoreUnexported(Stat{})); r != "" {
t.Error(r)
}
}