Skip to content

Commit

Permalink
Bump gotest.tools/v3 from 3.5.0 to 3.5.1
Browse files Browse the repository at this point in the history
Bumps [gotest.tools/v3](https://github.com/gotestyourself/gotest.tools) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/gotestyourself/gotest.tools/releases)
- [Commits](gotestyourself/gotest.tools@v3.5.0...v3.5.1)

---
updated-dependencies:
- dependency-name: gotest.tools/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored Oct 1, 2023
1 parent 4335bc9 commit 6abab2c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/urfave/cli/v2 v2.25.7
golang.org/x/crypto v0.12.0
golang.org/x/text v0.12.0
gotest.tools/v3 v3.5.0
gotest.tools/v3 v3.5.1
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UD
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=
gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
2 changes: 1 addition & 1 deletion vendor/gotest.tools/v3/internal/assert/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func RunComparison(
return true
}

if source.Update {
if source.IsUpdate() {
if updater, ok := result.(updateExpected); ok {
const stackIndex = 3 // Assert/Check, assert, RunComparison
err := updater.UpdatedExpected(stackIndex)
Expand Down
26 changes: 23 additions & 3 deletions vendor/gotest.tools/v3/internal/source/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,32 @@ import (
"strings"
)

// Update is set by the -update flag. It indicates the user running the tests
// would like to update any golden values.
// IsUpdate is returns true if the -update flag is set. It indicates the user
// running the tests would like to update any golden values.
func IsUpdate() bool {
if Update {
return true
}
return flag.Lookup("update").Value.(flag.Getter).Get().(bool)
}

// Update is a shim for testing, and for compatibility with the old -update-golden
// flag.
var Update bool

func init() {
flag.BoolVar(&Update, "update", false, "update golden values")
if f := flag.Lookup("update"); f != nil {
getter, ok := f.Value.(flag.Getter)
msg := "some other package defined an incompatible -update flag, expected a flag.Bool"
if !ok {
panic(msg)
}
if _, ok := getter.Get().(bool); !ok {
panic(msg)
}
return
}
flag.Bool("update", false, "update golden values")
}

// ErrNotFound indicates that UpdateExpectedValue failed to find the
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ golang.org/x/text/unicode/norm
# gopkg.in/cenkalti/backoff.v1 v1.1.0
## explicit
gopkg.in/cenkalti/backoff.v1
# gotest.tools/v3 v3.5.0
# gotest.tools/v3 v3.5.1
## explicit; go 1.17
gotest.tools/v3/assert
gotest.tools/v3/assert/cmp
Expand Down

0 comments on commit 6abab2c

Please sign in to comment.