banditcpp / bandit

Human-friendly unit testing for C++11
https://banditcpp.github.io/bandit/
Other
259 stars 37 forks source link

Improve string diff visualization #160

Open MartinDelille opened 4 years ago

MartinDelille commented 4 years ago

Visualising difference on big string is tricky.

I found this library: https://github.com/cubicdaiya/dtl

Do you think we could use it to improve string diff visualisation?

sbeyer commented 4 years ago

I think any attempts to visualize difference in the actual and expected strings in bandit (or snowhouse) would be feature creep.

sbeyer commented 3 years ago

I am currently using GTest at work and I noticed that GTest provides diff output. I never found it really useful but I can imagine that it may make sense for big strings (like file content).

I could imagine for snowhouse that it can be possible to register callbacks to assertions, and these callbacks are called when the assertion fails. This would allow the user to register a string diff routine (which could be mentioned as concrete example in the documentation, maybe using dti).