aaronabramov / k9

Rust testing library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

display only relevant parts in diff string

aaronabramov opened this issue · comments

when comparing large serialized strings (assert_equal or snapshots)
the diffs can get pretty large, with only 2-3 relevant lines.
we need to find a way to collapse the irrelevant parts, e.g.

Expected AAA to match snapshot:


... 100 lines

   value: 1
+ value: None
- value: Some(2),
  other_value: 2,

... 100 lines

not sure what the best way of collapsing, probably worth looking into other libraries that do that, like git output?