google / google/go-cmp

string difference not visible due to "elided lines"

Open
#311 7 comments 0 reactions 0 assignees View on GitHub
reporter
Dominant language
Go
Stars
4.7k
Forks
243
PR merge metrics
No merged PRs in 30d

Description

Sometimes I get output where the relevant difference between two strings is not shown because one or both get truncated with `elided lines`. Example:

```
-  SystemErr: Inverse(simplify, string(
-  """
-  > Enter [BeforeEach] e2e - cleanup_test.go:54

In this example, I started with the expected string set to empty, copied as much of the actual string as possible, and then repeated. But because not all of it was shown, I am missing some lines. I was hoping to get a diff with the missing lines, but the heuristics apparently decided to just show both strings.

The simplify function does some string->string replacement to get rid of some line numbers and time stamps.

It's not entirely clear to me why this happens. I tried to reproduce it with exactly these strings and without a transformer, but then it worked as expected (showed a diff). I also tried with a transformer, with the same result.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.