junit-report-rs icon indicating copy to clipboard operation
junit-report-rs copied to clipboard

Newlines are not possible to be encoded

Open def- opened this issue 1 year ago • 2 comments

Newlines in the message of a junit_report::TestCase::failure() are stored in the XML as straight newlines. When parsing the XML (for example with python-junit-xml) they are automatically stripped. Instead the newline should be encoded as 
.

As a workaround I tried &error.to_string().replace("\n", "
"), but the 
 is then encoded as 


def- avatar Nov 14 '24 21:11 def-

@def- Could you provide a test case that failes?

bachp avatar Nov 18 '24 08:11 bachp

Sure: https://github.com/bachp/junit-report-rs/pull/68

def- avatar Nov 18 '24 10:11 def-