-
Notifications
You must be signed in to change notification settings - Fork 40
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
deep diff by editscript #90
base: master
Are you sure you want to change the base?
Conversation
Build failed because the original branch depends on clojure 1.7.0 in project.clj |
Rather than changing how the 'pretty' reporter works, instead an 'editscript' reporter could be created instead. Can you also show the difference between the editscript diff, and how its reported currently? Is editscript the best Clojure diffing library to use? Are there alternatives, and what do they look like? |
I have no idea how much good an 'editscript' reporter is, because the 'pretty' reporter has lots of private functions which the report functions have to use. Maybe It might be that I don't understand what you mean. Could you explain a little more about that?
Comparing Clojure Diff Libraries will help you understand the difference and you can check the benchmark of different diff libraries in the blog. There are two diffing algorithms that is used in editscript library. Editscript A* is slow, but Editscript quick is fast. I use Editscript quick for comparing expected and actaul, and Editscript A* for making diffs only when expected is not equal to actaul Edit script is a way to quantify diffs between two strings, aka Levenshtein distance, which is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other. But this is ultimately reduced to the problem of the shortest path between two vertices in a graph which can be solved optimally by A* algorithm. If you want more informations, you can read ['Wu, S. et al., 1990, An O(NP) Sequence Comparison Algorithm, Information Processing Letters] on which editscript library is based. |
Why use
What private functions would you need? |
I think that the original
The problem is not what private function I need but the private functions themselves.
When using only clojure.test, it is possible to add new multimethod. Because all function in clojure.test is not private as mentioned there as below.
But it isn't possible to add new multimethod in eftest because the functions like |
I think this design complects what you're testing (equality) with how it's being displayed (diffs). The current design of Eftest is that the reporters determine how the test output is presented to the user, not the tests themselves. So if it showed a diff for failing data structures over a certain size, that would work better I think. Or if that behaviour could be forced via metadata on the test itself.
Sure, but you can wrap |
I add a feature of deep diffing by using editscript library.
I think It would be very useful especially for finding diffs between two big maps.
e= stands for 'editscript equal'
please review and let me know what you think!