Skip to content

Hashmap key order shouldn't matter #47

Closed

Description

@pesterhazy

It shouldn't matter in which order I add keys to a hashmap:

(ddiff/diff {:name "Alyysa P Hacker" :age 40} {:age 40 :name "Alyssa P Hacker"})

Expected

{:name #lambdaisland.deep_diff2.diff_impl.Mismatch{:- "Alyysa P Hacker", :+ "Alyssa P Hacker"}, :age 40}

Actual

The :age key is removed and re-added:

{#lambdaisland.deep_diff2.diff_impl.Insertion{:+ :age} 40, :name #lambdaisland.deep_diff2.diff_impl.Mismatch{:- "Alyysa P Hacker", :+ "Alyssa P Hacker"}, #lambdaisland.deep_diff2.diff_impl.Deletion{:- :age} 40}

Activity

  1. alysbrooks commented on Jun 19, 2023

    @alysbrooks
    Member

    Comparing different versions, it looks like it was introduced in 2.9.202. My first guess is that this was caused by #45. @latacora-paul, do you have time to look into this?

  2. added a commit that references this issue on Jun 19, 2023
  3. RutledgePaulV commented on Jun 19, 2023

    @RutledgePaulV
    Contributor

    @latacora-paul, do you have time to look into this?

    Sure, here's a PR that stops using the sequential del+ins that is causing the issue for maps and adds a test for this scenario:

    https://github.com/lambdaisland/deep-diff2/pull/48/files

  4. added a commit that references this issue on Jun 19, 2023
  5. added a commit that references this issue on Jul 24, 2023
  6. added a commit that references this issue on Feb 17, 2024
  7. moved this from Triage to ✅ Done in Lambda Island Open Sourceon Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions