Attempt to diff long strings when not equal

Our goal in this PR was to improve the UX for Equal() when both expected and
actual are very, very long strings.

Long strings (with more than 50 characters) that are not equal are typically
hard to visually diff when your tests fail. This change attempts to find the
very first mismatch in the strings and to visually point out where the diff
is. It additionally truncates the text, so it is easier to see the exact point.

Assumptions:
* people only need ~5 characters around the diff to identify WHERE it is
* 50 characters is a reasonable threshold for deciding to diff strings in this manner
* Equal() is the only matcher that needs this treatment (for now)

Would love feedback on these assumptions, or anything else.
4 files changed
tree: 36eac37430d2bd63abb2e85c0b67405be2826a1c
  1. format/
  2. gbytes/
  3. gexec/
  4. ghttp/
  5. gstruct/
  6. internal/
  7. matchers/
  8. types/
  9. .gitignore
  10. .travis.yml
  11. CHANGELOG.md
  12. gomega_dsl.go
  13. LICENSE
  14. matchers.go
  15. README.md
README.md

Gomega: Ginkgo's Preferred Matcher Library

Build Status

Jump straight to the docs to learn about Gomega, including a list of all available matchers.

To discuss Gomega and get updates, join the google group.

Ginkgo: a BDD Testing Framework for Golang

Learn more about Ginkgo here

Community Matchers

A collection of community matchers is available on the wiki.

License

Gomega is MIT-Licensed

The ConsistOf matcher uses goraph which is embedded in the source to simplify distribution. goraph has an MIT license.