You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I had exploring XmlUnit and found out that some test cases fails in assertj and assertj3 modules.
Here is a test results: failed_tests_result.zip (generated by Intellij IDEA).
These tests fails because I run them on Windows machine and where is a difference between Linux and Windows line separators.
On Linux line separator is \n and on Windows is \r\n.
So I propose to change \n in regular expressions to \R for failed tests.
Example:
//beforethrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\nto be valid but found following problems:\\n.*");
//afterthrown.expectAssertionErrorPattern("^\\RExpecting:\\R <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\Rto be valid but found following problems:\\R.*");
\R - is a special option in regex world and have meaning "any linebreak in Unicode". It's a synonym to (?:\r\n?|\n|\x0B|\f|\x85). (Wiki source)
Also some tests fails because javax.xml.parsers.DocumentBuilder always parse \r\n as \n. But assertions validate against %n which is formatted to \r\n in Windows.
To fix this kind of tests I propose to change
//before
thrown.expectAssertionError("Expected text value 'x' but was '%nx '");
//after
thrown.expectAssertionError("Expected text value 'x' but was '\nx '");
I will create a PR ASAP.
The text was updated successfully, but these errors were encountered:
Hi! I had exploring XmlUnit and found out that some test cases fails in assertj and assertj3 modules.
Here is a test results: failed_tests_result.zip (generated by Intellij IDEA).
These tests fails because I run them on Windows machine and where is a difference between Linux and Windows line separators.
On Linux line separator is
\n
and on Windows is\r\n
.So I propose to change
\n
in regular expressions to\R
for failed tests.Example:
\R
- is a special option in regex world and have meaning "any linebreak in Unicode". It's a synonym to(?:\r\n?|\n|\x0B|\f|\x85)
. (Wiki source)Also some tests fails because
javax.xml.parsers.DocumentBuilder
always parse\r\n
as\n
. But assertions validate against%n
which is formatted to\r\n
in Windows.To fix this kind of tests I propose to change
I will create a PR ASAP.
The text was updated successfully, but these errors were encountered: