Added tests only pinpoint the problem but many more could be added to cover the different use cases.
Logic of diffing is screwed up atm - commented to light up the problematic parts but aside from fixing what is need to overcome this bug did not refactor the entire thing (which should be done when more tests are in place).
This also reverts the diffing algorithm calculation to it's behavior pre v5.0.0
Added tests only pinpoint the problem but many more could be added to cover the different use cases. Logic of diffing is screwed up atm - commented to light up the problematic parts but aside from fixing what is need to overcome this bug did not refactor the entire thing (which should be done when more tests are in place).
This also reverts the diffing algorithm calculation to it's behavior pre v5.0.0