vendor: bump datadriven

Picks up some fixes for papercuts.
release-3.5
Tobias Schottdorf 2019-08-09 23:56:28 +02:00
parent 4a4629fd9f
commit f57c16c271
3 changed files with 37 additions and 28 deletions

2
go.mod
View File

@ -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
View File

@ -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=

View File

@ -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()
}
}