cli/command/formatter: remove deprecated compareMultipleValues() utility

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-07-10 15:51:07 +02:00
parent 03716c0a07
commit d642de78f3
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 6 additions and 15 deletions

View File

@ -8,6 +8,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/stringid"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
@ -90,7 +91,7 @@ func TestContainerPsContext(t *testing.T) {
ctx = ContainerContext{c: c.container, trunc: c.trunc} ctx = ContainerContext{c: c.container, trunc: c.trunc}
v := c.call() v := c.call()
if strings.Contains(v, ",") { if strings.Contains(v, ",") {
compareMultipleValues(t, v, c.expValue) test.CompareMultipleValues(t, v, c.expValue)
} else if v != c.expValue { } else if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v) t.Fatalf("Expected %s, was %s\n", c.expValue, v)
} }

View File

@ -1,12 +0,0 @@
package formatter
import (
"testing"
"github.com/docker/cli/internal/test"
)
// Deprecated: use internal/test.CompareMultipleValues instead
func compareMultipleValues(t *testing.T, value, expected string) {
test.CompareMultipleValues(t, value, expected)
}

View File

@ -7,6 +7,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/stringid"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
@ -88,7 +89,7 @@ func TestImageContext(t *testing.T) {
ctx = c.imageCtx ctx = c.imageCtx
v := c.call() v := c.call()
if strings.Contains(v, ",") { if strings.Contains(v, ",") {
compareMultipleValues(t, v, c.expValue) test.CompareMultipleValues(t, v, c.expValue)
} else { } else {
assert.Check(t, is.Equal(c.expValue, v)) assert.Check(t, is.Equal(c.expValue, v))
} }

View File

@ -7,6 +7,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/stringid"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
@ -46,7 +47,7 @@ func TestVolumeContext(t *testing.T) {
ctx = c.volumeCtx ctx = c.volumeCtx
v := c.call() v := c.call()
if strings.Contains(v, ",") { if strings.Contains(v, ",") {
compareMultipleValues(t, v, c.expValue) test.CompareMultipleValues(t, v, c.expValue)
} else if v != c.expValue { } else if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v) t.Fatalf("Expected %s, was %s\n", c.expValue, v)
} }