fix test
This commit is contained in:
parent
e0a7fb48b9
commit
45125bd02d
|
@ -6,6 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
"go-mod.ewintr.nl/planner/item"
|
"go-mod.ewintr.nl/planner/item"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -50,14 +51,10 @@ func TestMemoryUpdate(t *testing.T) {
|
||||||
if actErr != nil {
|
if actErr != nil {
|
||||||
t.Errorf("exp nil, got %v", actErr)
|
t.Errorf("exp nil, got %v", actErr)
|
||||||
}
|
}
|
||||||
if len(actItems) != 2 {
|
if diff := cmp.Diff([]item.Item{t1, t2}, actItems, cmpopts.SortSlices(func(i, j item.Item) bool {
|
||||||
t.Errorf("exp 2, gor %d", len(actItems))
|
return i.ID < j.ID
|
||||||
}
|
})); diff != "" {
|
||||||
if actItems[0].ID != t1.ID {
|
t.Errorf("(exp +, got -)\n%s", diff)
|
||||||
t.Errorf("exp %v, got %v", actItems[0].ID, t1.ID)
|
|
||||||
}
|
|
||||||
if actItems[1].ID != t2.ID {
|
|
||||||
t.Errorf("exp %v, got %v", actItems[1].ID, t2.ID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
actItems, actErr = mem.Updated([]item.Kind{}, before)
|
actItems, actErr = mem.Updated([]item.Kind{}, before)
|
||||||
|
|
Loading…
Reference in New Issue