Description
the tool works well when we have a id precised by user as the key. However I think when the user doesn't use the '--key' option, it's not working as expected.
for example:
----1.csv----
"""id,name,age
1,Cleo,5
2,Pancakes,2"""
----2.csv----
"""id,name,age
1,Cleo,5
2,Pancakes,3"""
and we launch with no key option :
csv-diff 1.csv 2.csv
we will get:
"2 rows added, 2 rows removed
2 rows added
id: 1
name: Cleo
age: 5
id: 2
name: Pancakes
age: 2
2 rows removed
id: 1
name: Cleo
age: 5
id: 2
name: Pancakes
age: 4
"
while i expect this:
"
1 row added, 1 row removed
1 row added:
id:2
name: Pancakes
age: 2
1 row removed:
id: 2
name: Pancakes
age: 4
"
the problem is caused because that the hash of the line is stored as a hash object, and even two lines are the same content, the memo locations are different. So they are different objects.
I have corrected this feature, if you like, I can upload it through a pull request.