New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestSuite: multi-line string diff support #38
Conversation
74207f6
to
170a0cb
Compare
Codecov ReportBase: 98.04% // Head: 98.05% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 98.04% 98.05% +0.01%
==========================================
Files 138 139 +1
Lines 11577 11639 +62
==========================================
+ Hits 11351 11413 +62
Misses 226 226
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
05dfcb1
to
aa37c2e
Compare
aa37c2e
to
75928ad
Compare
The diff algorithm is just the most basic thing possible, as even that is significantly better than having to compare stuff by eyeballing terminal output, or worse, opening an external diff tool. Eventually I may add collapsing of large common slices, or secondary diffing inside a line, this is just the first step on unblocking my productivity. It's implemented in a generic way so I can later reuse it for container differences as well (and differences on characters inside a line). I didn't spend any extra time on optimizing the algorithm further (apart from not using a STL map and/or allocating a new one in every iteration) as it's ran only on test failure which isn't really a critical path.
Returning an empty lambda doesn't solve anything, only hides bugs.
Ugh STL, imagine this was once considered "the normal way of doing things".
I'm tired of updating this every time I change ANYTHING in this file.
Don't just assume it works if color() works.
Need that for character diffs, heh.
Rather rudimentary at this point as it only handles the case of a single-line difference, not if for example two consecutive lines are both changed to something else. Maybe I'll figure that out later. Also contains a rather nasty "handling" of UTF-8 characters, in which case it just bails out of highlighting inside the line. Should be done in a better way eventually.
54b1f7b
to
731703e
Compare
TODO:
convert TestSuite::Tester test to it (maybe more? configuration tests?)no, make that opt-inDebug::inverseColor()
to show this nicelyhandle UTF-8 properlyskip if it would break UTF-8 characters, for nowconvertlaterTestSuite::FileToString
etc to use itSimple diff algorithm is at http://pynash.org/2013/02/26/diff-in-50-lines/ .