Skip to content

Normalize annotation values in XQSuite assertEquals for XML comparison#6085

Closed
joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz:fix/xqsuite-assertEquals-normalize-4327
Closed

Normalize annotation values in XQSuite assertEquals for XML comparison#6085
joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz:fix/xqsuite-assertEquals-normalize-4327

Conversation

@joewiz
Copy link
Copy Markdown
Member

@joewiz joewiz commented Mar 3, 2026

Summary

  • Fixes %test:assertEquals failing when the annotation value contains whitespace around XML (e.g., newlines before/after <span>)
  • The actual result was already normalized (whitespace stripped via test:normalize) but the expected value from the annotation was not, causing deep-equal to fail
  • Now both values are normalized before comparison, consistent with the XQSuite docs: "The assertion argument is then parsed into XML and the two node trees are compared using the deep-equals function"

Closes #4327

Test plan

  • Added XQSuite test with whitespace in %test:assertEquals annotation around XML element
  • All 91 existing XQSuite tests continue to pass

🤖 Generated with Claude Code

@joewiz joewiz requested a review from a team as a code owner March 3, 2026 14:02
…comparison (eXist-db#4327)

When comparing XML nodes in test:assertEquals, the actual result was
normalized (whitespace stripped) but the expected value from the
annotation was not. This caused assertions with whitespace around XML
in %test:assertEquals annotations to fail unexpectedly.

Now both values are normalized before comparison via deep-equal.

Closes eXist-db#4327

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@joewiz
Copy link
Copy Markdown
Member Author

joewiz commented Apr 6, 2026

[This comment was co-authored with Claude Code. -Joe]

Closing — superseded by #6207 (v2/xq31-compliance-fixes).

This work has been consolidated into a clean v2/ branch as part of the eXist-db 7.0 PR reorganization. The new PR includes all commits from this PR plus additional related work, with reviewer feedback incorporated where applicable. See the reviewer guide for the full context.

@joewiz joewiz closed this Apr 6, 2026
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.

Improve XQsuite %test:assertEquals to allow for easier comparison of XML trees

1 participant