mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
vendor: bump datadriven
Picks up some fixes for papercuts.
This commit is contained in:
parent
faa71d89d4
commit
69c97cdc8f
2
go.mod
2
go.mod
@ -2,7 +2,7 @@ module go.etcd.io/etcd
|
||||
|
||||
require (
|
||||
github.com/bgentry/speakeasy v0.1.0
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190531201743-edce55837238
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa
|
||||
github.com/coreos/go-semver v0.2.0
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7
|
||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf
|
||||
|
4
go.sum
4
go.sum
@ -9,8 +9,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
|
||||
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190531201743-edce55837238 h1:uNljlOxtOHrPnRoPPx+JanqjAGZpNiqAGVBfGskd/pg=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190531201743-edce55837238/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5tgDm3YN7+9dYrpK96E5wFilTFWIDZOM=
|
||||
|
59
vendor/github.com/cockroachdb/datadriven/datadriven.go
generated
vendored
59
vendor/github.com/cockroachdb/datadriven/datadriven.go
generated
vendored
@ -93,36 +93,45 @@ func runTestInternal(
|
||||
|
||||
r := newTestDataReader(t, sourceName, reader, rewrite)
|
||||
for r.Next(t) {
|
||||
d := &r.data
|
||||
actual := func() string {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Printf("\npanic during %s:\n%s\n", d.Pos, d.Input)
|
||||
panic(r)
|
||||
t.Run("", func(t *testing.T) {
|
||||
d := &r.data
|
||||
actual := func() string {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Printf("\npanic during %s:\n%s\n", d.Pos, d.Input)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
actual := f(d)
|
||||
if !strings.HasSuffix(actual, "\n") {
|
||||
actual += "\n"
|
||||
}
|
||||
return actual
|
||||
}()
|
||||
return f(d)
|
||||
}()
|
||||
|
||||
if r.rewrite != nil {
|
||||
r.emit("----")
|
||||
if hasBlankLine(actual) {
|
||||
if r.rewrite != nil {
|
||||
r.emit("----")
|
||||
r.rewrite.WriteString(actual)
|
||||
r.emit("----")
|
||||
r.emit("----")
|
||||
} else {
|
||||
r.emit(actual)
|
||||
if hasBlankLine(actual) {
|
||||
r.emit("----")
|
||||
r.rewrite.WriteString(actual)
|
||||
r.emit("----")
|
||||
r.emit("----")
|
||||
} else {
|
||||
r.emit(actual)
|
||||
}
|
||||
} else if d.Expected != actual {
|
||||
t.Fatalf("\n%s: %s\nexpected:\n%s\nfound:\n%s", d.Pos, d.Input, d.Expected, actual)
|
||||
} else if testing.Verbose() {
|
||||
input := d.Input
|
||||
if input == "" {
|
||||
input = "<no input to command>"
|
||||
}
|
||||
// TODO(tbg): it's awkward to reproduce the args, but it would be helpful.
|
||||
fmt.Printf("\n%s:\n%s [%d args]\n%s\n----\n%s", d.Pos, d.Cmd, len(d.CmdArgs), input, actual)
|
||||
}
|
||||
} else if d.Expected != actual {
|
||||
t.Fatalf("\n%s: %s\nexpected:\n%s\nfound:\n%s", d.Pos, d.Input, d.Expected, actual)
|
||||
} else if testing.Verbose() {
|
||||
input := d.Input
|
||||
if input == "" {
|
||||
input = "<no input to command>"
|
||||
}
|
||||
// TODO(tbg): it's awkward to reproduce the args, but it would be helpful.
|
||||
fmt.Printf("\n%s:\n%s [%d args]\n%s\n----\n%s", d.Pos, d.Cmd, len(d.CmdArgs), input, actual)
|
||||
})
|
||||
if t.Failed() {
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user