use consistent alias for gotest.tools/v3/assert/cmp
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
7eaae97e37
commit
378e754c88
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/docker/cli/cli-plugins/metadata"
|
"github.com/docker/cli/cli-plugins/metadata"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakeCandidate struct {
|
type fakeCandidate struct {
|
||||||
@ -81,7 +81,7 @@ func TestValidateCandidate(t *testing.T) {
|
|||||||
assert.ErrorContains(t, err, tc.err)
|
assert.ErrorContains(t, err, tc.err)
|
||||||
case tc.invalid != "":
|
case tc.invalid != "":
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Assert(t, cmp.ErrorType(p.Err, reflect.TypeOf(&pluginError{})))
|
assert.Assert(t, is.ErrorType(p.Err, reflect.TypeOf(&pluginError{})))
|
||||||
assert.ErrorContains(t, p.Err, tc.invalid)
|
assert.ErrorContains(t, p.Err, tc.invalid)
|
||||||
default:
|
default:
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/docker/docker/errdefs"
|
"github.com/docker/docker/errdefs"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testMetadata(name string) Metadata {
|
func testMetadata(name string) Metadata {
|
||||||
@ -69,8 +69,8 @@ func TestMetadataRespectJsonAnnotation(t *testing.T) {
|
|||||||
assert.NilError(t, testee.createOrUpdate(testMetadata("test")))
|
assert.NilError(t, testee.createOrUpdate(testMetadata("test")))
|
||||||
bytes, err := os.ReadFile(filepath.Join(testDir, string(contextdirOf("test")), "meta.json"))
|
bytes, err := os.ReadFile(filepath.Join(testDir, string(contextdirOf("test")), "meta.json"))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Assert(t, cmp.Contains(string(bytes), "a_very_recognizable_field_name"))
|
assert.Assert(t, is.Contains(string(bytes), "a_very_recognizable_field_name"))
|
||||||
assert.Assert(t, cmp.Contains(string(bytes), "another_very_recognizable_field_name"))
|
assert.Assert(t, is.Contains(string(bytes), "another_very_recognizable_field_name"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMetadataList(t *testing.T) {
|
func TestMetadataList(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user