use consistent alias for gotest.tools/v3/assert/cmp

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-05-16 12:36:14 +02:00
parent 7eaae97e37
commit 378e754c88
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/docker/cli/cli-plugins/metadata"
"github.com/spf13/cobra"
"gotest.tools/v3/assert"
"gotest.tools/v3/assert/cmp"
is "gotest.tools/v3/assert/cmp"
)
type fakeCandidate struct {
@ -81,7 +81,7 @@ func TestValidateCandidate(t *testing.T) {
assert.ErrorContains(t, err, tc.err)
case tc.invalid != "":
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)
default:
assert.NilError(t, err)

View File

@ -10,7 +10,7 @@ import (
"github.com/docker/docker/errdefs"
"gotest.tools/v3/assert"
"gotest.tools/v3/assert/cmp"
is "gotest.tools/v3/assert/cmp"
)
func testMetadata(name string) Metadata {
@ -69,8 +69,8 @@ func TestMetadataRespectJsonAnnotation(t *testing.T) {
assert.NilError(t, testee.createOrUpdate(testMetadata("test")))
bytes, err := os.ReadFile(filepath.Join(testDir, string(contextdirOf("test")), "meta.json"))
assert.NilError(t, err)
assert.Assert(t, cmp.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), "a_very_recognizable_field_name"))
assert.Assert(t, is.Contains(string(bytes), "another_very_recognizable_field_name"))
}
func TestMetadataList(t *testing.T) {