Skip to content
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

[Feature] More accurate detection of moved elements in array #127

Open
viclovsky opened this issue Aug 12, 2018 · 3 comments
Open

[Feature] More accurate detection of moved elements in array #127

viclovsky opened this issue Aug 12, 2018 · 3 comments

Comments

@viclovsky
Copy link
Contributor

JsonUnit does't detect moved elements in array.
So, for instance, we have array [1, 2, 3] and we get new array [1, 3, 2]. JsonUnit see that as 2 was changed to 3 and 3 was changed to 2 . It will be great if JsonUnit see that 2 change index to third and 3 chage index to second.
Is it possible to make?
After render we are able to see something like that
jsondiffpatch 2018-08-13 01-06-13
But now, we can see as bellow
mozilla firefox 2018-08-13 01-09-08

@lukas-krecan
Copy link
Owner

lukas-krecan commented Aug 19, 2018

Hi, unfortunately array comparison is already complicated as it is. I will think about it

@lukas-krecan
Copy link
Owner

I will be able to do that, at least in a special case, where there is no other difference. The question is, how to report it? Is it a new Difference.type (SWAPPED)?

@viclovsky
Copy link
Contributor Author

viclovsky commented Sep 5, 2018

It will be great if you implement this.

Is it a new Difference.type (SWAPPED)?

Yes, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants