Skip to content

Conversation

@lg2de
Copy link
Contributor

@lg2de lg2de commented Mar 19, 2020

Last year I provided rework of the assertion failure message when comparing XML by introducing XPath index.
Now I found that the current implementation can generate invalid XPath. The index could should apply to the parent.

Input

Compare

<root>
  <xml1 />
  <xml1><xml2 /><xml2 a=\"x\" /></xml1>
  <xml1>
    <xml2 />
    <xml2 a=\"x\" />
  </xml1>
</root>

with

<root>
  <xml1 />
  <xml1><xml2 /><xml2 a=\"x\" /></xml1>
  <xml1>
    <xml2 />
    <xml2 a=\"y\" /> <!-- note the different attribute -->
  </xml1>
</root>

Expected behavior

Expected attribute "a" at "/root/xml1[3]/xml2[2]" to have value "y", but found "x".

Actual behavior

Expected attribute "a" at "/root/xml1[3]/xml2[4]" to have value "y", but found "x".

@dennisdoomen dennisdoomen requested a review from jnyrup March 19, 2020 18:09
@lg2de
Copy link
Contributor Author

lg2de commented Mar 19, 2020

Maybe release notes are missing.
Depending on the schedule for 6.0 this fix could be targeted to 5.x?

Copy link
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that the fix is so simple 👍

@dennisdoomen
Copy link
Member

Depending on the schedule for 6.0 this fix could be targeted to 5.x?

But then you have to target master and rebase.

@dennisdoomen
Copy link
Member

We can close this one, right?

@lg2de
Copy link
Contributor Author

lg2de commented Mar 21, 2020

replaced by #1273

@lg2de lg2de closed this Mar 21, 2020
@lg2de lg2de deleted the XmlAssert branch March 21, 2020 11:10
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

Successfully merging this pull request may close these issues.

3 participants