Skip to content

Conversation

@lg2de
Copy link
Contributor

@lg2de lg2de commented Mar 20, 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.

This PR replaces #1272 to target 5.X

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 20, 2020 10:31
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.

Just to small typos and thanks for adding the missing release notes 👍

@jnyrup jnyrup merged commit 4787885 into fluentassertions:master Mar 21, 2020
@lg2de lg2de deleted the XmlAssert5X branch March 21, 2020 11:10
@dennisdoomen
Copy link
Member

@lg2de would you be willing to create a pull request from master to develop that resolves the conflicts?

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