rules_testing icon indicating copy to clipboard operation
rules_testing copied to clipboard

Show diff for large objects

Open rickeylev opened this issue 2 years ago • 1 comments

When large objects are compared, it makes the resulting errors hard to visually see what the differences are. This occurs with both large strings (e.g. generated BUILD file content for repository rule utilties) and large collections (e.g. the argv of a cc link command).

A diff would help draw attention to the parts of the expects vs actual that actually differ.

rickeylev avatar Jul 11 '23 20:07 rickeylev

+1 for this feature, right now I have to change:

that_str(got).equals(want)

to

that_collection(got.splitlines()).contains_exactly(want.splitlines())

However, this is not really equivalent, as the line endings may interfere with the result.

aignas avatar Jul 22 '23 03:07 aignas