ocaml-semver / ocaml-api-watch

Libraries and tools to keep watch on you OCaml lib's API changes
ISC License
21 stars 15 forks source link

Fix text diff representation of changes that span over multiple lines #73

Closed NathanReb closed 2 months ago

NathanReb commented 2 months ago

Diffs were previously not properly converted to text diffs when an individual value or module change would span over several lines.

It was turned into a single line of diff but was pretty printed over multiple lines, ending up in a misrepresented diff.

This adds a regression tests and a subsequent fix.

To simplify all this I extracted a Text_diff.pp function which I used to write an expect tests.