Merge pull request #43867 from thaJeztah/consistent_alias
use consistent alias for gotest.tools/v3/assert/cmp
This commit is contained in:
commit
3582c9da70
4 changed files with 76 additions and 78 deletions
|
@ -17,7 +17,7 @@ import (
|
||||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"go.etcd.io/bbolt"
|
"go.etcd.io/bbolt"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setupTestStores(t *testing.T) (context.Context, content.Store, *imageStoreWithLease, func(t *testing.T)) {
|
func setupTestStores(t *testing.T) (context.Context, content.Store, *imageStoreWithLease, func(t *testing.T)) {
|
||||||
|
@ -75,24 +75,24 @@ func TestImageDelete(t *testing.T) {
|
||||||
|
|
||||||
ls, err := images.leases.List(ctx)
|
ls, err := images.leases.List(ctx)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(len(ls), 1), ls)
|
assert.Check(t, is.Equal(len(ls), 1), ls)
|
||||||
|
|
||||||
_, err = images.Delete(id)
|
_, err = images.Delete(id)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
ls, err = images.leases.List(ctx)
|
ls, err = images.leases.List(ctx)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(len(ls), 0), ls)
|
assert.Check(t, is.Equal(len(ls), 0), ls)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestContentStoreForPull(t *testing.T) {
|
func TestContentStoreForPull(t *testing.T) {
|
||||||
ctx, cs, is, cleanup := setupTestStores(t)
|
ctx, cs, imgStore, cleanup := setupTestStores(t)
|
||||||
defer cleanup(t)
|
defer cleanup(t)
|
||||||
|
|
||||||
csP := &contentStoreForPull{
|
csP := &contentStoreForPull{
|
||||||
ContentStore: cs,
|
ContentStore: cs,
|
||||||
leases: is.leases,
|
leases: imgStore.leases,
|
||||||
}
|
}
|
||||||
|
|
||||||
data := []byte(`{}`)
|
data := []byte(`{}`)
|
||||||
|
@ -112,12 +112,12 @@ func TestContentStoreForPull(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, len(csP.digested), 1)
|
assert.Equal(t, len(csP.digested), 1)
|
||||||
assert.Check(t, cmp.Equal(csP.digested[0], desc.Digest))
|
assert.Check(t, is.Equal(csP.digested[0], desc.Digest))
|
||||||
|
|
||||||
// Test already exists
|
// Test already exists
|
||||||
csP.digested = nil
|
csP.digested = nil
|
||||||
_, err = csP.Writer(ctx, content.WithRef(t.Name()), content.WithDescriptor(desc))
|
_, err = csP.Writer(ctx, content.WithRef(t.Name()), content.WithDescriptor(desc))
|
||||||
assert.Check(t, c8derrdefs.IsAlreadyExists(err))
|
assert.Check(t, c8derrdefs.IsAlreadyExists(err))
|
||||||
assert.Equal(t, len(csP.digested), 1)
|
assert.Equal(t, len(csP.digested), 1)
|
||||||
assert.Check(t, cmp.Equal(csP.digested[0], desc.Digest))
|
assert.Check(t, is.Equal(csP.digested[0], desc.Digest))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
package cache
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"bytes"
|
|
||||||
|
|
||||||
"github.com/docker/docker/daemon/logger"
|
"github.com/docker/docker/daemon/logger"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakeLogger struct {
|
type fakeLogger struct {
|
||||||
|
@ -75,7 +73,7 @@ func TestLog(t *testing.T) {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
t.Fatal("timed out waiting for messages... this is probably a test implementation error")
|
t.Fatal("timed out waiting for messages... this is probably a test implementation error")
|
||||||
case msg = <-cacher.messages:
|
case msg = <-cacher.messages:
|
||||||
assert.Assert(t, cmp.DeepEqual(msg, m))
|
assert.Assert(t, is.DeepEqual(msg, m))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSharedTempFileConverter(t *testing.T) {
|
func TestSharedTempFileConverter(t *testing.T) {
|
||||||
|
@ -33,9 +33,9 @@ func TestSharedTempFileConverter(t *testing.T) {
|
||||||
t.Logf("Iteration %v", i)
|
t.Logf("Iteration %v", i)
|
||||||
|
|
||||||
rdr := convertPath(t, uut, name)
|
rdr := convertPath(t, uut, name)
|
||||||
assert.Check(t, cmp.Equal("HELLO, WORLD!", readAll(t, rdr)))
|
assert.Check(t, is.Equal("HELLO, WORLD!", readAll(t, rdr)))
|
||||||
assert.Check(t, rdr.Close())
|
assert.Check(t, rdr.Close())
|
||||||
assert.Check(t, cmp.Equal(fs.ErrClosed, rdr.Close()), "closing an already-closed reader should return an error")
|
assert.Check(t, is.Equal(fs.ErrClosed, rdr.Close()), "closing an already-closed reader should return an error")
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.NilError(t, os.Remove(name))
|
assert.NilError(t, os.Remove(name))
|
||||||
|
@ -67,15 +67,15 @@ func TestSharedTempFileConverter(t *testing.T) {
|
||||||
|
|
||||||
rb1 := convertPath(t, uut, bpath) // Same path, different file.
|
rb1 := convertPath(t, uut, bpath) // Same path, different file.
|
||||||
ra2 := convertPath(t, uut, apath) // New path, old file.
|
ra2 := convertPath(t, uut, apath) // New path, old file.
|
||||||
assert.Check(t, cmp.Equal(2, conversions), "expected only one conversion per unique file")
|
assert.Check(t, is.Equal(2, conversions), "expected only one conversion per unique file")
|
||||||
|
|
||||||
// Interleave reading and closing to shake out ref-counting bugs:
|
// Interleave reading and closing to shake out ref-counting bugs:
|
||||||
// closing one reader shouldn't affect any other open readers.
|
// closing one reader shouldn't affect any other open readers.
|
||||||
assert.Check(t, cmp.Equal("FILE A", readAll(t, ra1)))
|
assert.Check(t, is.Equal("FILE A", readAll(t, ra1)))
|
||||||
assert.NilError(t, ra1.Close())
|
assert.NilError(t, ra1.Close())
|
||||||
assert.Check(t, cmp.Equal("FILE A", readAll(t, ra2)))
|
assert.Check(t, is.Equal("FILE A", readAll(t, ra2)))
|
||||||
assert.NilError(t, ra2.Close())
|
assert.NilError(t, ra2.Close())
|
||||||
assert.Check(t, cmp.Equal("FILE B", readAll(t, rb1)))
|
assert.Check(t, is.Equal("FILE B", readAll(t, rb1)))
|
||||||
assert.NilError(t, rb1.Close())
|
assert.NilError(t, rb1.Close())
|
||||||
|
|
||||||
assert.NilError(t, os.Remove(apath))
|
assert.NilError(t, os.Remove(apath))
|
||||||
|
@ -120,7 +120,7 @@ func TestSharedTempFileConverter(t *testing.T) {
|
||||||
t.Logf("goroutine %v: enter", i)
|
t.Logf("goroutine %v: enter", i)
|
||||||
defer t.Logf("goroutine %v: exit", i)
|
defer t.Logf("goroutine %v: exit", i)
|
||||||
f := convertPath(t, uut, name)
|
f := convertPath(t, uut, name)
|
||||||
assert.Check(t, cmp.Equal("HI THERE", readAll(t, f)), "in goroutine %v", i)
|
assert.Check(t, is.Equal("HI THERE", readAll(t, f)), "in goroutine %v", i)
|
||||||
closers <- f
|
closers <- f
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
@ -138,12 +138,12 @@ func TestSharedTempFileConverter(t *testing.T) {
|
||||||
f := convertPath(t, uut, name)
|
f := convertPath(t, uut, name)
|
||||||
closers <- f
|
closers <- f
|
||||||
close(closers)
|
close(closers)
|
||||||
assert.Check(t, cmp.Equal("HI THERE", readAll(t, f)), "after all goroutines returned")
|
assert.Check(t, is.Equal("HI THERE", readAll(t, f)), "after all goroutines returned")
|
||||||
for c := range closers {
|
for c := range closers {
|
||||||
assert.Check(t, c.Close())
|
assert.Check(t, c.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Check(t, cmp.Equal(int32(1), conversions))
|
assert.Check(t, is.Equal(int32(1), conversions))
|
||||||
|
|
||||||
assert.NilError(t, os.Remove(name))
|
assert.NilError(t, os.Remove(name))
|
||||||
checkDirEmpty(t, dir)
|
checkDirEmpty(t, dir)
|
||||||
|
@ -197,7 +197,7 @@ func TestSharedTempFileConverter(t *testing.T) {
|
||||||
fakeErr = nil
|
fakeErr = nil
|
||||||
f, err := uut.Do(src)
|
f, err := uut.Do(src)
|
||||||
assert.Check(t, err)
|
assert.Check(t, err)
|
||||||
assert.Check(t, cmp.Equal("HI THERE", readAll(t, f)))
|
assert.Check(t, is.Equal("HI THERE", readAll(t, f)))
|
||||||
assert.Check(t, f.Close())
|
assert.Check(t, f.Close())
|
||||||
|
|
||||||
// Files pending delete continue to show up in directory
|
// Files pending delete continue to show up in directory
|
||||||
|
@ -241,7 +241,7 @@ func checkDirEmpty(t *testing.T, path string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
ls, err := os.ReadDir(path)
|
ls, err := os.ReadDir(path)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Len(ls, 0), "directory should be free of temp files")
|
assert.Check(t, is.Len(ls, 0), "directory should be free of temp files")
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyTransform(f func(string) string) func(dst io.WriteSeeker, src io.ReadSeeker) error {
|
func copyTransform(f func(string) string) func(dst io.WriteSeeker, src io.ReadSeeker) error {
|
||||||
|
|
|
@ -6,15 +6,15 @@ import (
|
||||||
|
|
||||||
"github.com/docker/docker/layer"
|
"github.com/docker/docker/layer"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreate(t *testing.T) {
|
func TestCreate(t *testing.T) {
|
||||||
is, cleanup := defaultImageStore(t)
|
imgStore, cleanup := defaultImageStore(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
_, err := is.Create([]byte(`{}`))
|
_, err := imgStore.Create([]byte(`{}`))
|
||||||
assert.Check(t, cmp.Error(err, "invalid image JSON, no RootFS key"))
|
assert.Check(t, is.Error(err, "invalid image JSON, no RootFS key"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRestore(t *testing.T) {
|
func TestRestore(t *testing.T) {
|
||||||
|
@ -33,118 +33,118 @@ func TestRestore(t *testing.T) {
|
||||||
err = fs.SetMetadata(id2, "parent", []byte(id1))
|
err = fs.SetMetadata(id2, "parent", []byte(id1))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
is, err := NewImageStore(fs, &mockLayerGetReleaser{})
|
imgStore, err := NewImageStore(fs, &mockLayerGetReleaser{})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
assert.Check(t, cmp.Len(is.Map(), 2))
|
assert.Check(t, is.Len(imgStore.Map(), 2))
|
||||||
|
|
||||||
img1, err := is.Get(ID(id1))
|
img1, err := imgStore.Get(ID(id1))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(ID(id1), img1.computedID))
|
assert.Check(t, is.Equal(ID(id1), img1.computedID))
|
||||||
assert.Check(t, cmp.Equal(string(id1), img1.computedID.String()))
|
assert.Check(t, is.Equal(string(id1), img1.computedID.String()))
|
||||||
|
|
||||||
img2, err := is.Get(ID(id2))
|
img2, err := imgStore.Get(ID(id2))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal("abc", img1.Comment))
|
assert.Check(t, is.Equal("abc", img1.Comment))
|
||||||
assert.Check(t, cmp.Equal("def", img2.Comment))
|
assert.Check(t, is.Equal("def", img2.Comment))
|
||||||
|
|
||||||
_, err = is.GetParent(ID(id1))
|
_, err = imgStore.GetParent(ID(id1))
|
||||||
assert.ErrorContains(t, err, "failed to read metadata")
|
assert.ErrorContains(t, err, "failed to read metadata")
|
||||||
|
|
||||||
p, err := is.GetParent(ID(id2))
|
p, err := imgStore.GetParent(ID(id2))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(ID(id1), p))
|
assert.Check(t, is.Equal(ID(id1), p))
|
||||||
|
|
||||||
children := is.Children(ID(id1))
|
children := imgStore.Children(ID(id1))
|
||||||
assert.Check(t, cmp.Len(children, 1))
|
assert.Check(t, is.Len(children, 1))
|
||||||
assert.Check(t, cmp.Equal(ID(id2), children[0]))
|
assert.Check(t, is.Equal(ID(id2), children[0]))
|
||||||
assert.Check(t, cmp.Len(is.Heads(), 1))
|
assert.Check(t, is.Len(imgStore.Heads(), 1))
|
||||||
|
|
||||||
sid1, err := is.Search(string(id1)[:10])
|
sid1, err := imgStore.Search(string(id1)[:10])
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(ID(id1), sid1))
|
assert.Check(t, is.Equal(ID(id1), sid1))
|
||||||
|
|
||||||
sid1, err = is.Search(id1.Hex()[:6])
|
sid1, err = imgStore.Search(id1.Hex()[:6])
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(ID(id1), sid1))
|
assert.Check(t, is.Equal(ID(id1), sid1))
|
||||||
|
|
||||||
invalidPattern := id1.Hex()[1:6]
|
invalidPattern := id1.Hex()[1:6]
|
||||||
_, err = is.Search(invalidPattern)
|
_, err = imgStore.Search(invalidPattern)
|
||||||
assert.ErrorContains(t, err, "No such image")
|
assert.ErrorContains(t, err, "No such image")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAddDelete(t *testing.T) {
|
func TestAddDelete(t *testing.T) {
|
||||||
is, cleanup := defaultImageStore(t)
|
imgStore, cleanup := defaultImageStore(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
id1, err := is.Create([]byte(`{"comment": "abc", "rootfs": {"type": "layers", "diff_ids": ["2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"]}}`))
|
id1, err := imgStore.Create([]byte(`{"comment": "abc", "rootfs": {"type": "layers", "diff_ids": ["2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"]}}`))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(ID("sha256:8d25a9c45df515f9d0fe8e4a6b1c64dd3b965a84790ddbcc7954bb9bc89eb993"), id1))
|
assert.Check(t, is.Equal(ID("sha256:8d25a9c45df515f9d0fe8e4a6b1c64dd3b965a84790ddbcc7954bb9bc89eb993"), id1))
|
||||||
|
|
||||||
img, err := is.Get(id1)
|
img, err := imgStore.Get(id1)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal("abc", img.Comment))
|
assert.Check(t, is.Equal("abc", img.Comment))
|
||||||
|
|
||||||
id2, err := is.Create([]byte(`{"comment": "def", "rootfs": {"type": "layers", "diff_ids": ["2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"]}}`))
|
id2, err := imgStore.Create([]byte(`{"comment": "def", "rootfs": {"type": "layers", "diff_ids": ["2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"]}}`))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
err = is.SetParent(id2, id1)
|
err = imgStore.SetParent(id2, id1)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
pid1, err := is.GetParent(id2)
|
pid1, err := imgStore.GetParent(id2)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(pid1, id1))
|
assert.Check(t, is.Equal(pid1, id1))
|
||||||
|
|
||||||
_, err = is.Delete(id1)
|
_, err = imgStore.Delete(id1)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
_, err = is.Get(id1)
|
_, err = imgStore.Get(id1)
|
||||||
assert.ErrorContains(t, err, "failed to get digest")
|
assert.ErrorContains(t, err, "failed to get digest")
|
||||||
|
|
||||||
_, err = is.Get(id2)
|
_, err = imgStore.Get(id2)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
_, err = is.GetParent(id2)
|
_, err = imgStore.GetParent(id2)
|
||||||
assert.ErrorContains(t, err, "failed to read metadata")
|
assert.ErrorContains(t, err, "failed to read metadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSearchAfterDelete(t *testing.T) {
|
func TestSearchAfterDelete(t *testing.T) {
|
||||||
is, cleanup := defaultImageStore(t)
|
imgStore, cleanup := defaultImageStore(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
id, err := is.Create([]byte(`{"comment": "abc", "rootfs": {"type": "layers"}}`))
|
id, err := imgStore.Create([]byte(`{"comment": "abc", "rootfs": {"type": "layers"}}`))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
id1, err := is.Search(string(id)[:15])
|
id1, err := imgStore.Search(string(id)[:15])
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(id1, id))
|
assert.Check(t, is.Equal(id1, id))
|
||||||
|
|
||||||
_, err = is.Delete(id)
|
_, err = imgStore.Delete(id)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
_, err = is.Search(string(id)[:15])
|
_, err = imgStore.Search(string(id)[:15])
|
||||||
assert.ErrorContains(t, err, "No such image")
|
assert.ErrorContains(t, err, "No such image")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParentReset(t *testing.T) {
|
func TestParentReset(t *testing.T) {
|
||||||
is, cleanup := defaultImageStore(t)
|
imgStore, cleanup := defaultImageStore(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
id, err := is.Create([]byte(`{"comment": "abc1", "rootfs": {"type": "layers"}}`))
|
id, err := imgStore.Create([]byte(`{"comment": "abc1", "rootfs": {"type": "layers"}}`))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
id2, err := is.Create([]byte(`{"comment": "abc2", "rootfs": {"type": "layers"}}`))
|
id2, err := imgStore.Create([]byte(`{"comment": "abc2", "rootfs": {"type": "layers"}}`))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
id3, err := is.Create([]byte(`{"comment": "abc3", "rootfs": {"type": "layers"}}`))
|
id3, err := imgStore.Create([]byte(`{"comment": "abc3", "rootfs": {"type": "layers"}}`))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
assert.Check(t, is.SetParent(id, id2))
|
assert.Check(t, imgStore.SetParent(id, id2))
|
||||||
assert.Check(t, cmp.Len(is.Children(id2), 1))
|
assert.Check(t, is.Len(imgStore.Children(id2), 1))
|
||||||
|
|
||||||
assert.Check(t, is.SetParent(id, id3))
|
assert.Check(t, imgStore.SetParent(id, id3))
|
||||||
assert.Check(t, cmp.Len(is.Children(id2), 0))
|
assert.Check(t, is.Len(imgStore.Children(id2), 0))
|
||||||
assert.Check(t, cmp.Len(is.Children(id3), 1))
|
assert.Check(t, is.Len(imgStore.Children(id3), 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
func defaultImageStore(t *testing.T) (Store, func()) {
|
func defaultImageStore(t *testing.T) (Store, func()) {
|
||||||
|
@ -165,13 +165,13 @@ func TestGetAndSetLastUpdated(t *testing.T) {
|
||||||
|
|
||||||
updated, err := store.GetLastUpdated(id)
|
updated, err := store.GetLastUpdated(id)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(updated.IsZero(), true))
|
assert.Check(t, is.Equal(updated.IsZero(), true))
|
||||||
|
|
||||||
assert.Check(t, store.SetLastUpdated(id))
|
assert.Check(t, store.SetLastUpdated(id))
|
||||||
|
|
||||||
updated, err = store.GetLastUpdated(id)
|
updated, err = store.GetLastUpdated(id)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, cmp.Equal(updated.IsZero(), false))
|
assert.Check(t, is.Equal(updated.IsZero(), false))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStoreLen(t *testing.T) {
|
func TestStoreLen(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue