Skip to content

Unexpected diff #11

Open
Open
@donmendelson

Description

@donmendelson

One test case reported an unexpected difference where elements were identical but in a different order. The current code failed to determine the elements that were the same.

The current logic to compare elements is as follows:

  1. Compare the element names.
  2. If the element names are the same, compare the values of "id" attribute if present.
  3. If the elements are the same and "id" is not present, compare the values of "name" attribute if present.

An order difference is detected if any of the above conditions report an unequal result. Only id and name attributes are considered keys; all other attributes are considered non-key.

In the example, the elements names were all the same but they contain neither "id" nor "name" attributes. Therefore, they are all considered equal from an ordering perspective. The "value" attribute and element text are thus reported as changes of elements that seemingly have not moved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions