Opened 9 years ago

Closed 9 years ago

#25191 closed Cleanup/optimization (fixed)

Better error output for assertXMLEqual

Reported by: Sergiy Kuzmenko Owned by: Caio Ariede
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It is difficult to understand test failures when comparing XML files. Currently error message shows the beginning of each XML string and output looks something like this:

AssertionError: '<?xml version="1.0" encoding="utf-8"?>\n<xliff version=\'1.2\'\n       xmlns=\' [truncated]... != '<?xml version="1.0" encoding="utf-8"?>\n<xliff version=\'1.2\' xmlns=\'urn:oasi [truncated]...

It would be very nice to have output similar to assertHTMLEqual, with markup differences highlighted like this:

AssertionError: <b>
Blue
</b>sky != <b>
Blue
</b>dye
  <b>
  Blue
- </b>sky
+ </b>dye

Change History (7)

comment:1 by Tim Graham, 9 years ago

Easy pickings: unset
Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

comment:2 by Caio Ariede, 9 years ago

Owner: changed from nobody to Caio Ariede
Status: newassigned

comment:4 by Tim Graham, 9 years ago

Has patch: set
Needs tests: set

Don't forget to check "Has patch" so the ticket appears in the review queue. Please uncheck "Needs tests" when updated, thanks.

comment:5 by Tim Graham, 9 years ago

Needs tests: unset

comment:6 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 62d4074:

Fixed #25191 -- Added string diff to SimpleTestCase.assertXMLEqual() message.

Note: See TracTickets for help on using tickets.
Back to Top