Browse code

Replace deprecated testutil.ErrorContains()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2018/05/21 07:06:50
Showing 28 changed files
... ...
@@ -6,9 +6,10 @@ import (
6 6
 
7 7
 	"github.com/docker/docker/builder/dockerfile/instructions"
8 8
 	"github.com/docker/docker/builder/remotecontext"
9
-	"github.com/docker/docker/internal/testutil"
10 9
 	"github.com/docker/docker/pkg/archive"
11 10
 	"github.com/docker/docker/pkg/reexec"
11
+	"github.com/gotestyourself/gotestyourself/assert"
12
+	is "github.com/gotestyourself/gotestyourself/assert/cmp"
12 13
 	"github.com/gotestyourself/gotestyourself/skip"
13 14
 )
14 15
 
... ...
@@ -139,5 +140,5 @@ func executeTestCase(t *testing.T, testCase dispatchTestCase) {
139 139
 	b := newBuilderWithMockBackend()
140 140
 	sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
141 141
 	err = dispatch(sb, testCase.cmd)
142
-	testutil.ErrorContains(t, err, testCase.expectedError)
142
+	assert.Check(t, is.ErrorContains(err, testCase.expectedError))
143 143
 }
... ...
@@ -6,7 +6,6 @@ import (
6 6
 
7 7
 	"github.com/docker/docker/builder/dockerfile/command"
8 8
 	"github.com/docker/docker/builder/dockerfile/parser"
9
-	"github.com/docker/docker/internal/testutil"
10 9
 	"github.com/gotestyourself/gotestyourself/assert"
11 10
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
12 11
 )
... ...
@@ -19,11 +18,11 @@ func TestCommandsExactlyOneArgument(t *testing.T) {
19 19
 		"STOPSIGNAL",
20 20
 	}
21 21
 
22
-	for _, command := range commands {
23
-		ast, err := parser.Parse(strings.NewReader(command))
22
+	for _, cmd := range commands {
23
+		ast, err := parser.Parse(strings.NewReader(cmd))
24 24
 		assert.NilError(t, err)
25 25
 		_, err = ParseInstruction(ast.AST.Children[0])
26
-		assert.Check(t, is.Error(err, errExactlyOneArgument(command).Error()))
26
+		assert.Check(t, is.Error(err, errExactlyOneArgument(cmd).Error()))
27 27
 	}
28 28
 }
29 29
 
... ...
@@ -37,11 +36,11 @@ func TestCommandsAtLeastOneArgument(t *testing.T) {
37 37
 		"VOLUME",
38 38
 	}
39 39
 
40
-	for _, command := range commands {
41
-		ast, err := parser.Parse(strings.NewReader(command))
40
+	for _, cmd := range commands {
41
+		ast, err := parser.Parse(strings.NewReader(cmd))
42 42
 		assert.NilError(t, err)
43 43
 		_, err = ParseInstruction(ast.AST.Children[0])
44
-		assert.Check(t, is.Error(err, errAtLeastOneArgument(command).Error()))
44
+		assert.Check(t, is.Error(err, errAtLeastOneArgument(cmd).Error()))
45 45
 	}
46 46
 }
47 47
 
... ...
@@ -51,11 +50,11 @@ func TestCommandsNoDestinationArgument(t *testing.T) {
51 51
 		"COPY",
52 52
 	}
53 53
 
54
-	for _, command := range commands {
55
-		ast, err := parser.Parse(strings.NewReader(command + " arg1"))
54
+	for _, cmd := range commands {
55
+		ast, err := parser.Parse(strings.NewReader(cmd + " arg1"))
56 56
 		assert.NilError(t, err)
57 57
 		_, err = ParseInstruction(ast.AST.Children[0])
58
-		assert.Check(t, is.Error(err, errNoDestinationArgument(command).Error()))
58
+		assert.Check(t, is.Error(err, errNoDestinationArgument(cmd).Error()))
59 59
 	}
60 60
 }
61 61
 
... ...
@@ -90,10 +89,10 @@ func TestCommandsBlankNames(t *testing.T) {
90 90
 		"LABEL",
91 91
 	}
92 92
 
93
-	for _, command := range commands {
93
+	for _, cmd := range commands {
94 94
 		node := &parser.Node{
95
-			Original: command + " =arg2",
96
-			Value:    strings.ToLower(command),
95
+			Original: cmd + " =arg2",
96
+			Value:    strings.ToLower(cmd),
97 97
 			Next: &parser.Node{
98 98
 				Value: "",
99 99
 				Next: &parser.Node{
... ...
@@ -102,7 +101,7 @@ func TestCommandsBlankNames(t *testing.T) {
102 102
 			},
103 103
 		}
104 104
 		_, err := ParseInstruction(node)
105
-		assert.Check(t, is.Error(err, errBlankCommandNames(command).Error()))
105
+		assert.Check(t, is.Error(err, errBlankCommandNames(cmd).Error()))
106 106
 	}
107 107
 }
108 108
 
... ...
@@ -134,7 +133,7 @@ func TestParseOptInterval(t *testing.T) {
134 134
 		Value:    "50ns",
135 135
 	}
136 136
 	_, err := parseOptInterval(flInterval)
137
-	testutil.ErrorContains(t, err, "cannot be less than 1ms")
137
+	assert.Check(t, is.ErrorContains(err, "cannot be less than 1ms"))
138 138
 
139 139
 	flInterval.Value = "1ms"
140 140
 	_, err = parseOptInterval(flInterval)
... ...
@@ -194,6 +193,6 @@ func TestErrorCases(t *testing.T) {
194 194
 		}
195 195
 		n := ast.AST.Children[0]
196 196
 		_, err = ParseInstruction(n)
197
-		testutil.ErrorContains(t, err, c.expectedError)
197
+		assert.Check(t, is.ErrorContains(err, c.expectedError))
198 198
 	}
199 199
 }
... ...
@@ -6,7 +6,6 @@ import (
6 6
 	"fmt"
7 7
 	"testing"
8 8
 
9
-	"github.com/docker/docker/internal/testutil"
10 9
 	"github.com/gotestyourself/gotestyourself/assert"
11 10
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
12 11
 )
... ...
@@ -48,7 +47,7 @@ func TestNormalizeDest(t *testing.T) {
48 48
 			}
49 49
 			assert.Check(t, is.Equal(testcase.expected, actual), msg)
50 50
 		} else {
51
-			testutil.ErrorContains(t, err, testcase.etext)
51
+			assert.Check(t, is.ErrorContains(err, testcase.etext))
52 52
 		}
53 53
 	}
54 54
 }
... ...
@@ -10,7 +10,6 @@ import (
10 10
 	"testing"
11 11
 
12 12
 	"github.com/docker/docker/builder"
13
-	"github.com/docker/docker/internal/testutil"
14 13
 	"github.com/gotestyourself/gotestyourself/assert"
15 14
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
16 15
 	"github.com/gotestyourself/gotestyourself/fs"
... ...
@@ -232,7 +231,7 @@ func TestGetWithStatusError(t *testing.T) {
232 232
 			assert.NilError(t, err)
233 233
 			assert.Check(t, is.Contains(string(body), testcase.expectedBody))
234 234
 		} else {
235
-			testutil.ErrorContains(t, err, testcase.expectedErr)
235
+			assert.Check(t, is.ErrorContains(err, testcase.expectedErr))
236 236
 		}
237 237
 	}
238 238
 }
... ...
@@ -10,7 +10,6 @@ import (
10 10
 
11 11
 	"github.com/docker/docker/api"
12 12
 	"github.com/docker/docker/api/types"
13
-	"github.com/docker/docker/internal/testutil"
14 13
 	"github.com/gotestyourself/gotestyourself/assert"
15 14
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
16 15
 	"github.com/gotestyourself/gotestyourself/env"
... ...
@@ -162,7 +161,7 @@ func TestParseHostURL(t *testing.T) {
162 162
 	for _, testcase := range testcases {
163 163
 		actual, err := ParseHostURL(testcase.host)
164 164
 		if testcase.expectedErr != "" {
165
-			testutil.ErrorContains(t, err, testcase.expectedErr)
165
+			assert.Check(t, is.ErrorContains(err, testcase.expectedErr))
166 166
 		}
167 167
 		assert.Check(t, is.DeepEqual(testcase.expected, actual))
168 168
 	}
... ...
@@ -2,6 +2,7 @@ package client // import "github.com/docker/docker/client"
2 2
 
3 3
 import (
4 4
 	"bytes"
5
+	"context"
5 6
 	"fmt"
6 7
 	"io"
7 8
 	"io/ioutil"
... ...
@@ -12,10 +13,9 @@ import (
12 12
 	"testing"
13 13
 	"time"
14 14
 
15
-	"context"
16
-
17 15
 	"github.com/docker/docker/api/types"
18
-	"github.com/docker/docker/internal/testutil"
16
+	"github.com/gotestyourself/gotestyourself/assert"
17
+	is "github.com/gotestyourself/gotestyourself/assert/cmp"
19 18
 )
20 19
 
21 20
 func TestContainerLogsNotFoundError(t *testing.T) {
... ...
@@ -39,11 +39,11 @@ func TestContainerLogsError(t *testing.T) {
39 39
 	_, err = client.ContainerLogs(context.Background(), "container_id", types.ContainerLogsOptions{
40 40
 		Since: "2006-01-02TZ",
41 41
 	})
42
-	testutil.ErrorContains(t, err, `parsing time "2006-01-02TZ"`)
42
+	assert.Check(t, is.ErrorContains(err, `parsing time "2006-01-02TZ"`))
43 43
 	_, err = client.ContainerLogs(context.Background(), "container_id", types.ContainerLogsOptions{
44 44
 		Until: "2006-01-02TZ",
45 45
 	})
46
-	testutil.ErrorContains(t, err, `parsing time "2006-01-02TZ"`)
46
+	assert.Check(t, is.ErrorContains(err, `parsing time "2006-01-02TZ"`))
47 47
 }
48 48
 
49 49
 func TestContainerLogs(t *testing.T) {
... ...
@@ -11,7 +11,6 @@ import (
11 11
 	"testing"
12 12
 
13 13
 	"github.com/docker/docker/api/types"
14
-	"github.com/docker/docker/internal/testutil"
15 14
 	"github.com/gotestyourself/gotestyourself/assert"
16 15
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
17 16
 )
... ...
@@ -22,7 +21,7 @@ func TestSwarmGetUnlockKeyError(t *testing.T) {
22 22
 	}
23 23
 
24 24
 	_, err := client.SwarmGetUnlockKey(context.Background())
25
-	testutil.ErrorContains(t, err, "Error response from daemon: Server error")
25
+	assert.Check(t, is.ErrorContains(err, "Error response from daemon: Server error"))
26 26
 }
27 27
 
28 28
 func TestSwarmGetUnlockKey(t *testing.T) {
... ...
@@ -11,7 +11,6 @@ import (
11 11
 	"testing"
12 12
 
13 13
 	"github.com/docker/docker/api/types"
14
-	"github.com/docker/docker/internal/testutil"
15 14
 	"github.com/gotestyourself/gotestyourself/assert"
16 15
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
17 16
 	"github.com/pkg/errors"
... ...
@@ -23,7 +22,7 @@ func TestVolumeInspectError(t *testing.T) {
23 23
 	}
24 24
 
25 25
 	_, err := client.VolumeInspect(context.Background(), "nothing")
26
-	testutil.ErrorContains(t, err, "Error response from daemon: Server error")
26
+	assert.Check(t, is.ErrorContains(err, "Error response from daemon: Server error"))
27 27
 }
28 28
 
29 29
 func TestVolumeInspectNotFound(t *testing.T) {
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"testing"
5 5
 
6 6
 	"github.com/docker/docker/daemon/config"
7
-	"github.com/docker/docker/internal/testutil"
8 7
 	"github.com/gotestyourself/gotestyourself/assert"
9 8
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
10 9
 	"github.com/gotestyourself/gotestyourself/fs"
... ...
@@ -58,7 +57,7 @@ func TestLoadDaemonCliConfigWithConflicts(t *testing.T) {
58 58
 	assert.Check(t, flags.Set("label", "l2=baz"))
59 59
 
60 60
 	_, err := loadDaemonCliConfig(opts)
61
-	testutil.ErrorContains(t, err, "as a flag and in the configuration file: labels")
61
+	assert.Check(t, is.ErrorContains(err, "as a flag and in the configuration file: labels"))
62 62
 }
63 63
 
64 64
 func TestLoadDaemonCliWithConflictingNodeGenericResources(t *testing.T) {
... ...
@@ -74,7 +73,7 @@ func TestLoadDaemonCliWithConflictingNodeGenericResources(t *testing.T) {
74 74
 	assert.Check(t, flags.Set("node-generic-resource", "r2=baz"))
75 75
 
76 76
 	_, err := loadDaemonCliConfig(opts)
77
-	testutil.ErrorContains(t, err, "as a flag and in the configuration file: node-generic-resources")
77
+	assert.Check(t, is.ErrorContains(err, "as a flag and in the configuration file: node-generic-resources"))
78 78
 }
79 79
 
80 80
 func TestLoadDaemonCliWithConflictingLabels(t *testing.T) {
... ...
@@ -7,7 +7,6 @@ import (
7 7
 	"testing"
8 8
 
9 9
 	"github.com/docker/docker/daemon/discovery"
10
-	"github.com/docker/docker/internal/testutil"
11 10
 	"github.com/docker/docker/opts"
12 11
 	"github.com/gotestyourself/gotestyourself/assert"
13 12
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
... ...
@@ -62,10 +61,7 @@ func TestFindConfigurationConflicts(t *testing.T) {
62 62
 
63 63
 	flags.String("authorization-plugins", "", "")
64 64
 	assert.Check(t, flags.Set("authorization-plugins", "asdf"))
65
-
66
-	testutil.ErrorContains(t,
67
-		findConfigurationConflicts(config, flags),
68
-		"authorization-plugins: (from flag: asdf, from file: foobar)")
65
+	assert.Check(t, is.ErrorContains(findConfigurationConflicts(config, flags), "authorization-plugins: (from flag: asdf, from file: foobar)"))
69 66
 }
70 67
 
71 68
 func TestFindConfigurationConflictsWithNamedOptions(t *testing.T) {
... ...
@@ -76,8 +72,7 @@ func TestFindConfigurationConflictsWithNamedOptions(t *testing.T) {
76 76
 	flags.VarP(opts.NewNamedListOptsRef("hosts", &hosts, opts.ValidateHost), "host", "H", "Daemon socket(s) to connect to")
77 77
 	assert.Check(t, flags.Set("host", "tcp://127.0.0.1:4444"))
78 78
 	assert.Check(t, flags.Set("host", "unix:///var/run/docker.sock"))
79
-
80
-	testutil.ErrorContains(t, findConfigurationConflicts(config, flags), "hosts")
79
+	assert.Check(t, is.ErrorContains(findConfigurationConflicts(config, flags), "hosts"))
81 80
 }
82 81
 
83 82
 func TestDaemonConfigurationMergeConflicts(t *testing.T) {
... ...
@@ -460,8 +455,7 @@ func TestReloadSetConfigFileNotExist(t *testing.T) {
460 460
 	flags.Set("config-file", configFile)
461 461
 
462 462
 	err := Reload(configFile, flags, func(c *Config) {})
463
-	assert.Check(t, is.ErrorContains(err, ""))
464
-	testutil.ErrorContains(t, err, "unable to configure the Docker daemon with file")
463
+	assert.Check(t, is.ErrorContains(err, "unable to configure the Docker daemon with file"))
465 464
 }
466 465
 
467 466
 // TestReloadDefaultConfigNotExist tests that if the default configuration file
... ...
@@ -494,8 +488,7 @@ func TestReloadBadDefaultConfig(t *testing.T) {
494 494
 	flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
495 495
 	flags.String("config-file", configFile, "")
496 496
 	err = Reload(configFile, flags, func(c *Config) {})
497
-	assert.Check(t, is.ErrorContains(err, ""))
498
-	testutil.ErrorContains(t, err, "unable to configure the Docker daemon with file")
497
+	assert.Check(t, is.ErrorContains(err, "unable to configure the Docker daemon with file"))
499 498
 }
500 499
 
501 500
 func TestReloadWithConflictingLabels(t *testing.T) {
... ...
@@ -508,7 +501,7 @@ func TestReloadWithConflictingLabels(t *testing.T) {
508 508
 	flags.String("config-file", configFile, "")
509 509
 	flags.StringSlice("labels", lbls, "")
510 510
 	err := Reload(configFile, flags, func(c *Config) {})
511
-	testutil.ErrorContains(t, err, "conflict labels for foo=baz and foo=bar")
511
+	assert.Check(t, is.ErrorContains(err, "conflict labels for foo=baz and foo=bar"))
512 512
 }
513 513
 
514 514
 func TestReloadWithDuplicateLabels(t *testing.T) {
... ...
@@ -9,8 +9,8 @@ import (
9 9
 	"github.com/docker/docker/api/types"
10 10
 	containertypes "github.com/docker/docker/api/types/container"
11 11
 	"github.com/docker/docker/container"
12
-	"github.com/docker/docker/internal/testutil"
13 12
 	"github.com/gotestyourself/gotestyourself/assert"
13
+	is "github.com/gotestyourself/gotestyourself/assert/cmp"
14 14
 )
15 15
 
16 16
 func newDaemonWithTmpRoot(t *testing.T) (*Daemon, func()) {
... ...
@@ -30,7 +30,6 @@ func newContainerWithState(state *container.State) *container.Container {
30 30
 		State:  state,
31 31
 		Config: &containertypes.Config{},
32 32
 	}
33
-
34 33
 }
35 34
 
36 35
 // TestContainerDelete tests that a useful error message and instructions is
... ...
@@ -74,8 +73,8 @@ func TestContainerDelete(t *testing.T) {
74 74
 		d.containers.Add(c.ID, c)
75 75
 
76 76
 		err := d.ContainerRm(c.ID, &types.ContainerRmConfig{ForceRemove: false})
77
-		testutil.ErrorContains(t, err, te.errMsg)
78
-		testutil.ErrorContains(t, err, te.fixMsg)
77
+		assert.Check(t, is.ErrorContains(err, te.errMsg))
78
+		assert.Check(t, is.ErrorContains(err, te.fixMsg))
79 79
 	}
80 80
 }
81 81
 
... ...
@@ -92,5 +91,5 @@ func TestContainerDoubleDelete(t *testing.T) {
92 92
 	// Try to remove the container when its state is removalInProgress.
93 93
 	// It should return an error indicating it is under removal progress.
94 94
 	err := d.ContainerRm(c.ID, &types.ContainerRmConfig{ForceRemove: true})
95
-	testutil.ErrorContains(t, err, fmt.Sprintf("removal of container %s is already in progress", c.ID))
95
+	assert.Check(t, is.ErrorContains(err, fmt.Sprintf("removal of container %s is already in progress", c.ID)))
96 96
 }
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"testing"
5 5
 	"time"
6 6
 
7
-	"github.com/docker/docker/internal/testutil"
8 7
 	"github.com/gotestyourself/gotestyourself/assert"
9 8
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
10 9
 )
... ...
@@ -12,11 +11,11 @@ import (
12 12
 func TestFastTimeMarshalJSONWithInvalidYear(t *testing.T) {
13 13
 	aTime := time.Date(-1, 1, 1, 0, 0, 0, 0, time.Local)
14 14
 	_, err := fastTimeMarshalJSON(aTime)
15
-	testutil.ErrorContains(t, err, "year outside of range")
15
+	assert.Check(t, is.ErrorContains(err, "year outside of range"))
16 16
 
17 17
 	anotherTime := time.Date(10000, 1, 1, 0, 0, 0, 0, time.Local)
18 18
 	_, err = fastTimeMarshalJSON(anotherTime)
19
-	testutil.ErrorContains(t, err, "year outside of range")
19
+	assert.Check(t, is.ErrorContains(err, "year outside of range"))
20 20
 }
21 21
 
22 22
 func TestFastTimeMarshalJSON(t *testing.T) {
... ...
@@ -6,7 +6,6 @@ import (
6 6
 	"path/filepath"
7 7
 	"testing"
8 8
 
9
-	"github.com/docker/docker/internal/testutil"
10 9
 	"github.com/gotestyourself/gotestyourself/assert"
11 10
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
12 11
 	"github.com/gotestyourself/gotestyourself/fs"
... ...
@@ -22,7 +21,7 @@ func TestLoadOrCreateTrustKeyInvalidKeyFile(t *testing.T) {
22 22
 	assert.NilError(t, err)
23 23
 
24 24
 	_, err = loadOrCreateTrustKey(tmpKeyFile.Name())
25
-	testutil.ErrorContains(t, err, "Error loading key file")
25
+	assert.Check(t, is.ErrorContains(err, "Error loading key file"))
26 26
 }
27 27
 
28 28
 func TestLoadOrCreateTrustKeyCreateKeyWhenFileDoesNotExist(t *testing.T) {
... ...
@@ -10,7 +10,8 @@ import (
10 10
 
11 11
 	"github.com/docker/distribution/manifest/schema1"
12 12
 	"github.com/docker/distribution/reference"
13
-	"github.com/docker/docker/internal/testutil"
13
+	"github.com/gotestyourself/gotestyourself/assert"
14
+	is "github.com/gotestyourself/gotestyourself/assert/cmp"
14 15
 	"github.com/opencontainers/go-digest"
15 16
 )
16 17
 
... ...
@@ -104,7 +105,7 @@ func TestFixManifestLayersBadParent(t *testing.T) {
104 104
 	}
105 105
 
106 106
 	err := fixManifestLayers(&duplicateLayerManifest)
107
-	testutil.ErrorContains(t, err, "invalid parent ID")
107
+	assert.Check(t, is.ErrorContains(err, "invalid parent ID"))
108 108
 }
109 109
 
110 110
 // TestValidateManifest verifies the validateManifest function
... ...
@@ -10,10 +10,9 @@ import (
10 10
 	"path/filepath"
11 11
 	"testing"
12 12
 
13
-	"github.com/docker/docker/internal/testutil"
14 13
 	"github.com/gotestyourself/gotestyourself/assert"
15 14
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
16
-	digest "github.com/opencontainers/go-digest"
15
+	"github.com/opencontainers/go-digest"
17 16
 )
18 17
 
19 18
 func defaultFSStoreBackend(t *testing.T) (StoreBackend, func()) {
... ...
@@ -39,7 +38,7 @@ func TestFSGetInvalidData(t *testing.T) {
39 39
 	assert.Check(t, err)
40 40
 
41 41
 	_, err = store.Get(id)
42
-	testutil.ErrorContains(t, err, "failed to verify")
42
+	assert.Check(t, is.ErrorContains(err, "failed to verify"))
43 43
 }
44 44
 
45 45
 func TestFSInvalidSet(t *testing.T) {
... ...
@@ -51,7 +50,7 @@ func TestFSInvalidSet(t *testing.T) {
51 51
 	assert.Check(t, err)
52 52
 
53 53
 	_, err = store.Set([]byte("foobar"))
54
-	testutil.ErrorContains(t, err, "failed to write digest data")
54
+	assert.Check(t, is.ErrorContains(err, "failed to write digest data"))
55 55
 }
56 56
 
57 57
 func TestFSInvalidRoot(t *testing.T) {
... ...
@@ -78,7 +77,7 @@ func TestFSInvalidRoot(t *testing.T) {
78 78
 		f.Close()
79 79
 
80 80
 		_, err = NewFSStoreBackend(root)
81
-		testutil.ErrorContains(t, err, "failed to create storage backend")
81
+		assert.Check(t, is.ErrorContains(err, "failed to create storage backend"))
82 82
 
83 83
 		os.RemoveAll(root)
84 84
 	}
... ...
@@ -116,14 +115,14 @@ func TestFSMetadataGetSet(t *testing.T) {
116 116
 	}
117 117
 
118 118
 	_, err = store.GetMetadata(id2, "tkey2")
119
-	testutil.ErrorContains(t, err, "failed to read metadata")
119
+	assert.Check(t, is.ErrorContains(err, "failed to read metadata"))
120 120
 
121 121
 	id3 := digest.FromBytes([]byte("baz"))
122 122
 	err = store.SetMetadata(id3, "tkey", []byte("tval"))
123
-	testutil.ErrorContains(t, err, "failed to get digest")
123
+	assert.Check(t, is.ErrorContains(err, "failed to get digest"))
124 124
 
125 125
 	_, err = store.GetMetadata(id3, "tkey")
126
-	testutil.ErrorContains(t, err, "failed to get digest")
126
+	assert.Check(t, is.ErrorContains(err, "failed to get digest"))
127 127
 }
128 128
 
129 129
 func TestFSInvalidWalker(t *testing.T) {
... ...
@@ -191,7 +190,7 @@ func TestFSGetUnsetKey(t *testing.T) {
191 191
 
192 192
 	for _, key := range []digest.Digest{"foobar:abc", "sha256:abc", "sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2a"} {
193 193
 		_, err := store.Get(key)
194
-		testutil.ErrorContains(t, err, "failed to get digest")
194
+		assert.Check(t, is.ErrorContains(err, "failed to get digest"))
195 195
 	}
196 196
 }
197 197
 
... ...
@@ -201,7 +200,7 @@ func TestFSGetEmptyData(t *testing.T) {
201 201
 
202 202
 	for _, emptyData := range [][]byte{nil, {}} {
203 203
 		_, err := store.Set(emptyData)
204
-		testutil.ErrorContains(t, err, "invalid empty data")
204
+		assert.Check(t, is.ErrorContains(err, "invalid empty data"))
205 205
 	}
206 206
 }
207 207
 
... ...
@@ -219,7 +218,7 @@ func TestFSDelete(t *testing.T) {
219 219
 	assert.Check(t, err)
220 220
 
221 221
 	_, err = store.Get(id)
222
-	testutil.ErrorContains(t, err, "failed to get digest")
222
+	assert.Check(t, is.ErrorContains(err, "failed to get digest"))
223 223
 
224 224
 	_, err = store.Get(id2)
225 225
 	assert.Check(t, err)
... ...
@@ -228,7 +227,7 @@ func TestFSDelete(t *testing.T) {
228 228
 	assert.Check(t, err)
229 229
 
230 230
 	_, err = store.Get(id2)
231
-	testutil.ErrorContains(t, err, "failed to get digest")
231
+	assert.Check(t, is.ErrorContains(err, "failed to get digest"))
232 232
 }
233 233
 
234 234
 func TestFSWalker(t *testing.T) {
... ...
@@ -267,5 +266,5 @@ func TestFSWalkerStopOnError(t *testing.T) {
267 267
 	err = store.Walk(func(id digest.Digest) error {
268 268
 		return errors.New("what")
269 269
 	})
270
-	testutil.ErrorContains(t, err, "what")
270
+	assert.Check(t, is.ErrorContains(err, "what"))
271 271
 }
... ...
@@ -13,7 +13,6 @@ import (
13 13
 	swarmtypes "github.com/docker/docker/api/types/swarm"
14 14
 	"github.com/docker/docker/client"
15 15
 	"github.com/docker/docker/integration/internal/swarm"
16
-	"github.com/docker/docker/internal/testutil"
17 16
 	"github.com/docker/docker/pkg/stdcopy"
18 17
 	"github.com/gotestyourself/gotestyourself/assert"
19 18
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
... ...
@@ -136,7 +135,7 @@ func TestConfigsCreateAndDelete(t *testing.T) {
136 136
 	assert.NilError(t, err)
137 137
 
138 138
 	insp, _, err = client.ConfigInspectWithRaw(ctx, configID)
139
-	testutil.ErrorContains(t, err, "No such config")
139
+	assert.Check(t, is.ErrorContains(err, "No such config"))
140 140
 }
141 141
 
142 142
 func TestConfigsUpdate(t *testing.T) {
... ...
@@ -190,7 +189,7 @@ func TestConfigsUpdate(t *testing.T) {
190 190
 	// this test will produce an error in func UpdateConfig
191 191
 	insp.Spec.Data = []byte("TESTINGDATA2")
192 192
 	err = client.ConfigUpdate(ctx, configID, insp.Version, insp.Spec)
193
-	testutil.ErrorContains(t, err, "only updates to Labels are allowed")
193
+	assert.Check(t, is.ErrorContains(err, "only updates to Labels are allowed"))
194 194
 }
195 195
 
196 196
 func TestTemplatedConfig(t *testing.T) {
... ...
@@ -8,7 +8,6 @@ import (
8 8
 	"github.com/docker/docker/api/types"
9 9
 	"github.com/docker/docker/client"
10 10
 	"github.com/docker/docker/integration/internal/container"
11
-	"github.com/docker/docker/internal/testutil"
12 11
 	"github.com/gotestyourself/gotestyourself/assert"
13 12
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
14 13
 	"github.com/gotestyourself/gotestyourself/skip"
... ...
@@ -22,9 +21,9 @@ func TestCopyFromContainerPathDoesNotExist(t *testing.T) {
22 22
 	cid := container.Create(t, ctx, apiclient)
23 23
 
24 24
 	_, _, err := apiclient.CopyFromContainer(ctx, cid, "/dne")
25
-	assert.Assert(t, client.IsErrNotFound(err))
25
+	assert.Check(t, client.IsErrNotFound(err))
26 26
 	expected := fmt.Sprintf("No such container:path: %s:%s", cid, "/dne")
27
-	testutil.ErrorContains(t, err, expected)
27
+	assert.Check(t, is.ErrorContains(err, expected))
28 28
 }
29 29
 
30 30
 func TestCopyFromContainerPathIsNotDir(t *testing.T) {
... ...
@@ -36,7 +35,7 @@ func TestCopyFromContainerPathIsNotDir(t *testing.T) {
36 36
 	cid := container.Create(t, ctx, apiclient)
37 37
 
38 38
 	_, _, err := apiclient.CopyFromContainer(ctx, cid, "/etc/passwd/")
39
-	assert.Assert(t, is.Contains(err.Error(), "not a directory"))
39
+	assert.Assert(t, is.ErrorContains(err, "not a directory"))
40 40
 }
41 41
 
42 42
 func TestCopyToContainerPathDoesNotExist(t *testing.T) {
... ...
@@ -48,9 +47,9 @@ func TestCopyToContainerPathDoesNotExist(t *testing.T) {
48 48
 	cid := container.Create(t, ctx, apiclient)
49 49
 
50 50
 	err := apiclient.CopyToContainer(ctx, cid, "/dne", nil, types.CopyToContainerOptions{})
51
-	assert.Assert(t, client.IsErrNotFound(err))
51
+	assert.Check(t, client.IsErrNotFound(err))
52 52
 	expected := fmt.Sprintf("No such container:path: %s:%s", cid, "/dne")
53
-	testutil.ErrorContains(t, err, expected)
53
+	assert.Check(t, is.ErrorContains(err, expected))
54 54
 }
55 55
 
56 56
 func TestCopyToContainerPathIsNotDir(t *testing.T) {
... ...
@@ -62,5 +61,5 @@ func TestCopyToContainerPathIsNotDir(t *testing.T) {
62 62
 	cid := container.Create(t, ctx, apiclient)
63 63
 
64 64
 	err := apiclient.CopyToContainer(ctx, cid, "/etc/passwd/", nil, types.CopyToContainerOptions{})
65
-	assert.Assert(t, is.Contains(err.Error(), "not a directory"))
65
+	assert.Assert(t, is.ErrorContains(err, "not a directory"))
66 66
 }
... ...
@@ -8,7 +8,8 @@ import (
8 8
 	"github.com/docker/docker/api/types/container"
9 9
 	"github.com/docker/docker/api/types/network"
10 10
 	"github.com/docker/docker/internal/test/request"
11
-	"github.com/docker/docker/internal/testutil"
11
+	"github.com/gotestyourself/gotestyourself/assert"
12
+	is "github.com/gotestyourself/gotestyourself/assert/cmp"
12 13
 	"github.com/gotestyourself/gotestyourself/skip"
13 14
 )
14 15
 
... ...
@@ -48,7 +49,7 @@ func TestCreateFailsWhenIdentifierDoesNotExist(t *testing.T) {
48 48
 				&network.NetworkingConfig{},
49 49
 				"",
50 50
 			)
51
-			testutil.ErrorContains(t, err, tc.expectedError)
51
+			assert.Check(t, is.ErrorContains(err, tc.expectedError))
52 52
 		})
53 53
 	}
54 54
 }
... ...
@@ -88,7 +89,7 @@ func TestCreateWithInvalidEnv(t *testing.T) {
88 88
 				&network.NetworkingConfig{},
89 89
 				"",
90 90
 			)
91
-			testutil.ErrorContains(t, err, tc.expectedError)
91
+			assert.Check(t, is.ErrorContains(err, tc.expectedError))
92 92
 		})
93 93
 	}
94 94
 }
... ...
@@ -133,6 +134,6 @@ func TestCreateTmpfsMountsTarget(t *testing.T) {
133 133
 			&network.NetworkingConfig{},
134 134
 			"",
135 135
 		)
136
-		testutil.ErrorContains(t, err, tc.expectedError)
136
+		assert.Check(t, is.ErrorContains(err, tc.expectedError))
137 137
 	}
138 138
 }
... ...
@@ -12,7 +12,6 @@ import (
12 12
 	"github.com/docker/docker/api/types/versions"
13 13
 	"github.com/docker/docker/integration/internal/container"
14 14
 	"github.com/docker/docker/internal/test/request"
15
-	"github.com/docker/docker/internal/testutil"
16 15
 	"github.com/gotestyourself/gotestyourself/assert"
17 16
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
18 17
 	"github.com/gotestyourself/gotestyourself/poll"
... ...
@@ -62,7 +61,7 @@ func TestPauseFailsOnWindowsServerContainers(t *testing.T) {
62 62
 	poll.WaitOn(t, container.IsInState(ctx, client, cID, "running"), poll.WithDelay(100*time.Millisecond))
63 63
 
64 64
 	err := client.ContainerPause(ctx, cID)
65
-	testutil.ErrorContains(t, err, "cannot pause Windows Server Containers")
65
+	assert.Check(t, is.ErrorContains(err, "cannot pause Windows Server Containers"))
66 66
 }
67 67
 
68 68
 func TestPauseStopPausedContainer(t *testing.T) {
... ...
@@ -10,7 +10,6 @@ import (
10 10
 	"github.com/docker/docker/api/types/filters"
11 11
 	"github.com/docker/docker/integration/internal/container"
12 12
 	"github.com/docker/docker/internal/test/request"
13
-	"github.com/docker/docker/internal/testutil"
14 13
 	"github.com/gotestyourself/gotestyourself/assert"
15 14
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
16 15
 	"github.com/gotestyourself/gotestyourself/fs"
... ...
@@ -50,7 +49,7 @@ func TestRemoveContainerWithRemovedVolume(t *testing.T) {
50 50
 	assert.NilError(t, err)
51 51
 
52 52
 	_, _, err = client.ContainerInspectWithRaw(ctx, cID, true)
53
-	testutil.ErrorContains(t, err, "No such container")
53
+	assert.Check(t, is.ErrorContains(err, "No such container"))
54 54
 }
55 55
 
56 56
 // Test case for #2099/#2125
... ...
@@ -87,7 +86,7 @@ func TestRemoveContainerRunning(t *testing.T) {
87 87
 	cID := container.Run(t, ctx, client)
88 88
 
89 89
 	err := client.ContainerRemove(ctx, cID, types.ContainerRemoveOptions{})
90
-	testutil.ErrorContains(t, err, "cannot remove a running container")
90
+	assert.Check(t, is.ErrorContains(err, "cannot remove a running container"))
91 91
 }
92 92
 
93 93
 func TestRemoveContainerForceRemoveRunning(t *testing.T) {
... ...
@@ -109,5 +108,5 @@ func TestRemoveInvalidContainer(t *testing.T) {
109 109
 	client := request.NewAPIClient(t)
110 110
 
111 111
 	err := client.ContainerRemove(ctx, "unknown", types.ContainerRemoveOptions{})
112
-	testutil.ErrorContains(t, err, "No such container")
112
+	assert.Check(t, is.ErrorContains(err, "No such container"))
113 113
 }
... ...
@@ -11,7 +11,6 @@ import (
11 11
 	"github.com/docker/docker/api/types/versions"
12 12
 	"github.com/docker/docker/integration/internal/container"
13 13
 	"github.com/docker/docker/internal/test/request"
14
-	"github.com/docker/docker/internal/testutil"
15 14
 	"github.com/docker/docker/pkg/stringid"
16 15
 	"github.com/gotestyourself/gotestyourself/assert"
17 16
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
... ...
@@ -89,7 +88,7 @@ func TestRenameRunningContainerAndReuse(t *testing.T) {
89 89
 	assert.Check(t, is.Equal("/"+newName, inspect.Name))
90 90
 
91 91
 	_, err = client.ContainerInspect(ctx, oldName)
92
-	testutil.ErrorContains(t, err, "No such container: "+oldName)
92
+	assert.Check(t, is.ErrorContains(err, "No such container: "+oldName))
93 93
 
94 94
 	cID = container.Run(t, ctx, client, container.WithName(oldName))
95 95
 	poll.WaitOn(t, container.IsInState(ctx, client, cID, "running"), poll.WithDelay(100*time.Millisecond))
... ...
@@ -109,7 +108,7 @@ func TestRenameInvalidName(t *testing.T) {
109 109
 	poll.WaitOn(t, container.IsInState(ctx, client, cID, "running"), poll.WithDelay(100*time.Millisecond))
110 110
 
111 111
 	err := client.ContainerRename(ctx, oldName, "new:invalid")
112
-	testutil.ErrorContains(t, err, "Invalid container name")
112
+	assert.Check(t, is.ErrorContains(err, "Invalid container name"))
113 113
 
114 114
 	inspect, err := client.ContainerInspect(ctx, oldName)
115 115
 	assert.NilError(t, err)
... ...
@@ -179,9 +178,9 @@ func TestRenameContainerWithSameName(t *testing.T) {
179 179
 
180 180
 	poll.WaitOn(t, container.IsInState(ctx, client, cID, "running"), poll.WithDelay(100*time.Millisecond))
181 181
 	err := client.ContainerRename(ctx, oldName, oldName)
182
-	testutil.ErrorContains(t, err, "Renaming a container with the same name")
182
+	assert.Check(t, is.ErrorContains(err, "Renaming a container with the same name"))
183 183
 	err = client.ContainerRename(ctx, cID, oldName)
184
-	testutil.ErrorContains(t, err, "Renaming a container with the same name")
184
+	assert.Check(t, is.ErrorContains(err, "Renaming a container with the same name"))
185 185
 }
186 186
 
187 187
 // Test case for GitHub issue 23973
... ...
@@ -11,7 +11,6 @@ import (
11 11
 	"github.com/docker/docker/integration/internal/container"
12 12
 	"github.com/docker/docker/internal/test/request"
13 13
 	req "github.com/docker/docker/internal/test/request"
14
-	"github.com/docker/docker/internal/testutil"
15 14
 	"github.com/gotestyourself/gotestyourself/assert"
16 15
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
17 16
 	"github.com/gotestyourself/gotestyourself/poll"
... ...
@@ -63,5 +62,5 @@ func TestResizeWhenContainerNotStarted(t *testing.T) {
63 63
 		Height: 40,
64 64
 		Width:  40,
65 65
 	})
66
-	testutil.ErrorContains(t, err, "is not running")
66
+	assert.Check(t, is.ErrorContains(err, "is not running"))
67 67
 }
... ...
@@ -8,7 +8,6 @@ import (
8 8
 	containertypes "github.com/docker/docker/api/types/container"
9 9
 	"github.com/docker/docker/integration/internal/container"
10 10
 	"github.com/docker/docker/internal/test/request"
11
-	"github.com/docker/docker/internal/testutil"
12 11
 	"github.com/gotestyourself/gotestyourself/assert"
13 12
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
14 13
 	"github.com/gotestyourself/gotestyourself/poll"
... ...
@@ -61,5 +60,5 @@ func TestUpdateRestartWithAutoRemove(t *testing.T) {
61 61
 			Name: "always",
62 62
 		},
63 63
 	})
64
-	testutil.ErrorContains(t, err, "Restart policy cannot be updated because AutoRemove is enabled for the container")
64
+	assert.Check(t, is.ErrorContains(err, "Restart policy cannot be updated because AutoRemove is enabled for the container"))
65 65
 }
... ...
@@ -7,7 +7,6 @@ import (
7 7
 	"github.com/docker/docker/api/types"
8 8
 	"github.com/docker/docker/integration/internal/container"
9 9
 	"github.com/docker/docker/internal/test/request"
10
-	"github.com/docker/docker/internal/testutil"
11 10
 	"github.com/gotestyourself/gotestyourself/assert"
12 11
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
13 12
 )
... ...
@@ -56,5 +55,5 @@ func TestRemoveImageOrphaning(t *testing.T) {
56 56
 
57 57
 	// check if the second image has been deleted
58 58
 	_, _, err = client.ImageInspectWithRaw(ctx, commitResp2.ID)
59
-	testutil.ErrorContains(t, err, "No such image:")
59
+	assert.Check(t, is.ErrorContains(err, "No such image:"))
60 60
 }
... ...
@@ -39,7 +39,7 @@ func TestTagInvalidReference(t *testing.T) {
39 39
 
40 40
 	for _, repo := range invalidRepos {
41 41
 		err := client.ImageTag(ctx, "busybox", repo)
42
-		testutil.ErrorContains(t, err, "not a valid repository/tag")
42
+		assert.Check(t, is.ErrorContains(err, "not a valid repository/tag"))
43 43
 	}
44 44
 
45 45
 	longTag := testutil.GenerateRandomAlphaOnlyString(121)
... ...
@@ -48,24 +48,24 @@ func TestTagInvalidReference(t *testing.T) {
48 48
 
49 49
 	for _, repotag := range invalidTags {
50 50
 		err := client.ImageTag(ctx, "busybox", repotag)
51
-		testutil.ErrorContains(t, err, "not a valid repository/tag")
51
+		assert.Check(t, is.ErrorContains(err, "not a valid repository/tag"))
52 52
 	}
53 53
 
54 54
 	// test repository name begin with '-'
55 55
 	err := client.ImageTag(ctx, "busybox:latest", "-busybox:test")
56
-	testutil.ErrorContains(t, err, "Error parsing reference")
56
+	assert.Check(t, is.ErrorContains(err, "Error parsing reference"))
57 57
 
58 58
 	// test namespace name begin with '-'
59 59
 	err = client.ImageTag(ctx, "busybox:latest", "-test/busybox:test")
60
-	testutil.ErrorContains(t, err, "Error parsing reference")
60
+	assert.Check(t, is.ErrorContains(err, "Error parsing reference"))
61 61
 
62 62
 	// test index name begin with '-'
63 63
 	err = client.ImageTag(ctx, "busybox:latest", "-index:5000/busybox:test")
64
-	testutil.ErrorContains(t, err, "Error parsing reference")
64
+	assert.Check(t, is.ErrorContains(err, "Error parsing reference"))
65 65
 
66 66
 	// test setting tag fails
67 67
 	err = client.ImageTag(ctx, "busybox:latest", "sha256:sometag")
68
-	testutil.ErrorContains(t, err, "refusing to create an ambiguous tag using digest algorithm as name")
68
+	assert.Check(t, is.ErrorContains(err, "refusing to create an ambiguous tag using digest algorithm as name"))
69 69
 }
70 70
 
71 71
 // ensure we allow the use of valid tags
... ...
@@ -132,8 +132,9 @@ func TestTagMatchesDigest(t *testing.T) {
132 132
 	digest := "busybox@sha256:abcdef76720241213f5303bda7704ec4c2ef75613173910a56fb1b6e20251507"
133 133
 	// test setting tag fails
134 134
 	err := client.ImageTag(ctx, "busybox:latest", digest)
135
-	testutil.ErrorContains(t, err, "refusing to create a tag with a digest reference")
135
+	assert.Check(t, is.ErrorContains(err, "refusing to create a tag with a digest reference"))
136
+
136 137
 	// check that no new image matches the digest
137 138
 	_, _, err = client.ImageInspectWithRaw(ctx, digest)
138
-	testutil.ErrorContains(t, err, fmt.Sprintf("No such image: %s", digest))
139
+	assert.Check(t, is.ErrorContains(err, fmt.Sprintf("No such image: %s", digest)))
139 140
 }
... ...
@@ -12,7 +12,6 @@ import (
12 12
 	swarmtypes "github.com/docker/docker/api/types/swarm"
13 13
 	"github.com/docker/docker/client"
14 14
 	"github.com/docker/docker/integration/internal/swarm"
15
-	"github.com/docker/docker/internal/testutil"
16 15
 	"github.com/docker/docker/pkg/stdcopy"
17 16
 	"github.com/gotestyourself/gotestyourself/assert"
18 17
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
... ...
@@ -148,17 +147,17 @@ func TestSecretsCreateAndDelete(t *testing.T) {
148 148
 		},
149 149
 		Data: []byte("TESTINGDATA"),
150 150
 	})
151
-	testutil.ErrorContains(t, err, "already exists")
151
+	assert.Check(t, is.ErrorContains(err, "already exists"))
152 152
 
153 153
 	// Ported from original TestSecretsDelete
154 154
 	err = client.SecretRemove(ctx, secretID)
155 155
 	assert.NilError(t, err)
156 156
 
157 157
 	_, _, err = client.SecretInspectWithRaw(ctx, secretID)
158
-	testutil.ErrorContains(t, err, "No such secret")
158
+	assert.Check(t, is.ErrorContains(err, "No such secret"))
159 159
 
160 160
 	err = client.SecretRemove(ctx, "non-existin")
161
-	testutil.ErrorContains(t, err, "No such secret: non-existin")
161
+	assert.Check(t, is.ErrorContains(err, "No such secret: non-existin"))
162 162
 
163 163
 	// Ported from original TestSecretsCreteaWithLabels
164 164
 	testName = "test_secret_with_labels"
... ...
@@ -223,7 +222,7 @@ func TestSecretsUpdate(t *testing.T) {
223 223
 	// this test will produce an error in func UpdateSecret
224 224
 	insp.Spec.Data = []byte("TESTINGDATA2")
225 225
 	err = client.SecretUpdate(ctx, secretID, insp.Version, insp.Spec)
226
-	testutil.ErrorContains(t, err, "only updates to Labels are allowed")
226
+	assert.Check(t, is.ErrorContains(err, "only updates to Labels are allowed"))
227 227
 }
228 228
 
229 229
 func TestTemplatedSecret(t *testing.T) {
... ...
@@ -12,7 +12,6 @@ import (
12 12
 	volumetypes "github.com/docker/docker/api/types/volume"
13 13
 	"github.com/docker/docker/integration/internal/container"
14 14
 	"github.com/docker/docker/internal/test/request"
15
-	"github.com/docker/docker/internal/testutil"
16 15
 	"github.com/google/go-cmp/cmp/cmpopts"
17 16
 	"github.com/gotestyourself/gotestyourself/assert"
18 17
 	is "github.com/gotestyourself/gotestyourself/assert/cmp"
... ...
@@ -63,7 +62,7 @@ func TestVolumesRemove(t *testing.T) {
63 63
 	vname := c.Mounts[0].Name
64 64
 
65 65
 	err = client.VolumeRemove(ctx, vname, false)
66
-	testutil.ErrorContains(t, err, "volume is in use")
66
+	assert.Check(t, is.ErrorContains(err, "volume is in use"))
67 67
 
68 68
 	err = client.ContainerRemove(ctx, id, types.ContainerRemoveOptions{
69 69
 		Force: true,
... ...
@@ -2,24 +2,8 @@ package testutil // import "github.com/docker/docker/internal/testutil"
2 2
 
3 3
 import (
4 4
 	"io"
5
-
6
-	"github.com/gotestyourself/gotestyourself/assert"
7 5
 )
8 6
 
9
-type helperT interface {
10
-	Helper()
11
-}
12
-
13
-// ErrorContains checks that the error is not nil, and contains the expected
14
-// substring.
15
-// Deprecated: use assert.Assert(t, cmp.ErrorContains(err, expected))
16
-func ErrorContains(t assert.TestingT, err error, expectedError string, msgAndArgs ...interface{}) {
17
-	if ht, ok := t.(helperT); ok {
18
-		ht.Helper()
19
-	}
20
-	assert.ErrorContains(t, err, expectedError, msgAndArgs...)
21
-}
22
-
23 7
 // DevZero acts like /dev/zero but in an OS-independent fashion.
24 8
 var DevZero io.Reader = devZero{}
25 9