summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/gomega/format
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-12-09 08:37:22 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-12-09 08:37:22 -0500
commit228df27b5496098f8b06c3296517fd55471c9865 (patch)
tree4fc292d2b58ac9fd9669c3e40ed194aa6cadd333 /vendor/github.com/onsi/gomega/format
parent247260081a5cdc4065009bcd1080c987974327e5 (diff)
downloadpodman-228df27b5496098f8b06c3296517fd55471c9865.tar.gz
podman-228df27b5496098f8b06c3296517fd55471c9865.tar.bz2
podman-228df27b5496098f8b06c3296517fd55471c9865.zip
Bump github.com/onsi/gomega from 1.10.3 to 1.10.4
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.10.3 to 1.10.4. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.10.3...v1.10.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/onsi/gomega/format')
-rw-r--r--vendor/github.com/onsi/gomega/format/format.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/onsi/gomega/format/format.go b/vendor/github.com/onsi/gomega/format/format.go
index fae25adce..e59d7d75b 100644
--- a/vendor/github.com/onsi/gomega/format/format.go
+++ b/vendor/github.com/onsi/gomega/format/format.go
@@ -105,7 +105,13 @@ func MessageWithDiff(actual, message, expected string) string {
tabLength := 4
spaceFromMessageToActual := tabLength + len("<string>: ") - len(message)
- padding := strings.Repeat(" ", spaceFromMessageToActual+spacesBeforeFormattedMismatch) + "|"
+
+ paddingCount := spaceFromMessageToActual + spacesBeforeFormattedMismatch
+ if paddingCount < 0 {
+ return Message(formattedActual, message, formattedExpected)
+ }
+
+ padding := strings.Repeat(" ", paddingCount) + "|"
return Message(formattedActual, message+padding, formattedExpected)
}