Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 79352ce

Browse files
author
Vincent Demeester
authored
Merge pull request #204 from vdemeester/update-gotestyourself
Update gotestyourself to gotest.tools
2 parents e2ffeae + d86318e commit 79352ce

28 files changed

Lines changed: 90 additions & 78 deletions

Gopkg.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/binary_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"strings"
1414
"testing"
1515

16-
"github.com/gotestyourself/gotestyourself/assert"
17-
"github.com/gotestyourself/gotestyourself/fs"
18-
"github.com/gotestyourself/gotestyourself/golden"
19-
"github.com/gotestyourself/gotestyourself/icmd"
16+
"gotest.tools/assert"
17+
"gotest.tools/fs"
18+
"gotest.tools/golden"
19+
"gotest.tools/icmd"
2020

2121
"github.com/docker/app/utils"
2222
)

e2e/render_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/docker/app/internal"
1111
"github.com/docker/app/renderer"
1212

13-
"github.com/gotestyourself/gotestyourself/assert"
1413
"gopkg.in/yaml.v2"
14+
"gotest.tools/assert"
1515
)
1616

1717
func gather(t *testing.T, dir string) ([]string, []string, map[string]string) {

packager/init_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"path/filepath"
99
"testing"
1010

11-
"github.com/gotestyourself/gotestyourself/assert"
12-
"github.com/gotestyourself/gotestyourself/fs"
11+
"gotest.tools/assert"
12+
"gotest.tools/fs"
1313

1414
"github.com/docker/app/utils"
1515
)

utils/io_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package utils
33
import (
44
"testing"
55

6-
"github.com/gotestyourself/gotestyourself/assert"
7-
"github.com/gotestyourself/gotestyourself/fs"
6+
"gotest.tools/assert"
7+
"gotest.tools/fs"
88

99
"strings"
1010
)

utils/names_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/gotestyourself/gotestyourself/assert"
7+
"gotest.tools/assert"
88
)
99

1010
func TestValidateAppName(t *testing.T) {

vendor/github.com/gotestyourself/gotestyourself/LICENSE renamed to vendor/gotest.tools/LICENSE

File renamed without changes.

vendor/github.com/gotestyourself/gotestyourself/assert/assert.go renamed to vendor/gotest.tools/assert/assert.go

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The example below shows assert used with some common types.
1616
import (
1717
"testing"
1818
19-
"github.com/gotestyourself/gotestyourself/assert"
20-
is "github.com/gotestyourself/gotestyourself/assert/cmp"
19+
"gotest.tools/assert"
20+
is "gotest.tools/assert/cmp"
2121
)
2222
2323
func TestEverything(t *testing.T) {
@@ -49,7 +49,7 @@ The example below shows assert used with some common types.
4949
5050
Comparisons
5151
52-
Package assert/cmp (http://bit.do/assert-cmp) provides
52+
Package https://godoc.org/gotest.tools/assert/cmp provides
5353
many common comparisons. Additional comparisons can be written to compare
5454
values in other ways. See the example Assert (CustomComparison).
5555
@@ -62,17 +62,17 @@ See http://bit.do/cmd-gty-migrate-from-testify.
6262
6363
6464
*/
65-
package assert
65+
package assert // import "gotest.tools/assert"
6666

6767
import (
6868
"fmt"
6969
"go/ast"
7070
"go/token"
7171

7272
gocmp "github.com/google/go-cmp/cmp"
73-
"github.com/gotestyourself/gotestyourself/assert/cmp"
74-
"github.com/gotestyourself/gotestyourself/internal/format"
75-
"github.com/gotestyourself/gotestyourself/internal/source"
73+
"gotest.tools/assert/cmp"
74+
"gotest.tools/internal/format"
75+
"gotest.tools/internal/source"
7676
)
7777

7878
// BoolOrComparison can be a bool, or cmp.Comparison. See Assert() for usage.
@@ -242,7 +242,17 @@ func NilError(t TestingT, err error, msgAndArgs ...interface{}) {
242242
}
243243

244244
// Equal uses the == operator to assert two values are equal and fails the test
245-
// if they are not equal. This is equivalent to Assert(t, cmp.Equal(x, y)).
245+
// if they are not equal.
246+
//
247+
// If the comparison fails Equal will use the variable names for x and y as part
248+
// of the failure message to identify the actual and expected values.
249+
//
250+
// If either x or y are a multi-line string the failure message will include a
251+
// unified diff of the two values. If the values only differ by whitespace
252+
// the unified diff will be augmented by replacing whitespace characters with
253+
// visible characters to identify the whitespace difference.
254+
//
255+
// This is equivalent to Assert(t, cmp.Equal(x, y)).
246256
func Equal(t TestingT, x, y interface{}, msgAndArgs ...interface{}) {
247257
if ht, ok := t.(helperT); ok {
248258
ht.Helper()
@@ -253,7 +263,7 @@ func Equal(t TestingT, x, y interface{}, msgAndArgs ...interface{}) {
253263
// DeepEqual uses google/go-cmp (http://bit.do/go-cmp) to assert two values are
254264
// equal and fails the test if they are not equal.
255265
//
256-
// Package assert/opt (http://bit.do/t-assert-opt) provides some additional
266+
// Package https://godoc.org/gotest.tools/assert/opt provides some additional
257267
// commonly used Options.
258268
//
259269
// This is equivalent to Assert(t, cmp.DeepEqual(x, y)).

vendor/github.com/gotestyourself/gotestyourself/assert/cmp/compare.go renamed to vendor/gotest.tools/assert/cmp/compare.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*Package cmp provides Comparisons for Assert and Check*/
2-
package cmp
2+
package cmp // import "gotest.tools/assert/cmp"
33

44
import (
55
"fmt"
66
"reflect"
77
"strings"
88

99
"github.com/google/go-cmp/cmp"
10-
"github.com/gotestyourself/gotestyourself/internal/format"
10+
"gotest.tools/internal/format"
1111
)
1212

1313
// Comparison is a function which compares values and returns ResultSuccess if
@@ -19,7 +19,7 @@ type Comparison func() Result
1919
// and succeeds if the values are equal.
2020
//
2121
// The comparison can be customized using comparison Options.
22-
// Package assert/opt (http://bit.do/t-assert-opt) provides some additional
22+
// Package https://godoc.org/gotest.tools/assert/opt provides some additional
2323
// commonly used Options.
2424
func DeepEqual(x, y interface{}, opts ...cmp.Option) Comparison {
2525
return func() (result Result) {
@@ -58,7 +58,7 @@ func toResult(success bool, msg string) Result {
5858
return ResultFailure(msg)
5959
}
6060

61-
// Equal succeeds if x == y.
61+
// Equal succeeds if x == y. See assert.Equal for full documentation.
6262
func Equal(x, y interface{}) Comparison {
6363
return func() Result {
6464
switch {

vendor/github.com/gotestyourself/gotestyourself/assert/cmp/result.go renamed to vendor/gotest.tools/assert/cmp/result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"go/ast"
77
"text/template"
88

9-
"github.com/gotestyourself/gotestyourself/internal/source"
9+
"gotest.tools/internal/source"
1010
)
1111

1212
// Result of a Comparison.

0 commit comments

Comments
 (0)