-
Notifications
You must be signed in to change notification settings - Fork 63
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
Unexpected difference between diffs of hashes vs. arrays #43
Comments
Maybe you can try |
I get the same results using |
That probably means there are bugs in the implementation. Unfortunately, I don't have time budge to work on it. If you are interested in digging deeper and make a PR, that is always appreciated. |
It works with: pry(main)> HashDiff.diff [1, 2, 3], [1, 10, 3], use_lcs: false
=> [["~", "[1]", 2, 10]] |
I think LCS doesn't really work here. obj1 = [1, 1, 1, 2]
obj2 = [2, 1, 1, 1]
HashDiff.diff(obj1, obj2, { use_lcs: true })
=> [["+", "[0]", 2], ["-", "[4]", 2]]
HashDiff.diff(obj1, obj2, { use_lcs: false })
=> [["~", "[0]", 1, 2], ["~", "[3]", 2, 1]] |
I have inputs
and expect a diff of
but instead I get
I expect that because of how hash comparisons work
and
Is it possible to get the results I expect?
The text was updated successfully, but these errors were encountered: