bump gotest.tools v2.3.0, google/go-cmp v0.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2019-04-05 10:52:24 +02:00
parent 591e52c504
commit 1978c0b74b
23 changed files with 399 additions and 424 deletions

View File

@@ -30,12 +30,12 @@ func (r *defaultReporter) Report(x, y reflect.Value, eq bool, p Path) {
const maxLines = 256
r.ndiffs++
if r.nbytes < maxBytes && r.nlines < maxLines {
sx := value.Format(x, true)
sy := value.Format(y, true)
sx := value.Format(x, value.FormatConfig{UseStringer: true})
sy := value.Format(y, value.FormatConfig{UseStringer: true})
if sx == sy {
// Stringer is not helpful, so rely on more exact formatting.
sx = value.Format(x, false)
sy = value.Format(y, false)
// Unhelpful output, so use more exact formatting.
sx = value.Format(x, value.FormatConfig{PrintPrimitiveType: true})
sy = value.Format(y, value.FormatConfig{PrintPrimitiveType: true})
}
s := fmt.Sprintf("%#v:\n\t-: %s\n\t+: %s\n", p, sx, sy)
r.diffs = append(r.diffs, s)
@@ -49,5 +49,5 @@ func (r *defaultReporter) String() string {
if r.ndiffs == len(r.diffs) {
return s
}
return fmt.Sprintf("%s... %d more differences ...", s, len(r.diffs)-r.ndiffs)
return fmt.Sprintf("%s... %d more differences ...", s, r.ndiffs-len(r.diffs))
}