Skip to content

Commit 50ff600

Browse files
committed
issue-252: Adopt tests for Windows OS
1 parent 0a61c82 commit 50ff600

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

xmlunit-assertj/src/test/java/org/xmlunit/assertj/CompareAssertAreIdenticalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void testAreIdentical_withIgnoreWhitespaceAndTextValue_shouldPass() {
185185
public void testAreIdentical_withIgnoreElementContentWhitespace_shouldFailed() {
186186

187187
thrown.expectAssertionError("Expecting:%n <control instance> and <test instance> to be identical");
188-
thrown.expectAssertionError("Expected text value 'x' but was '%nx '");
188+
thrown.expectAssertionError("Expected text value 'x' but was '\nx '");
189189

190190
String testXml = String.format("<a>%nx <b/>%n</a>");
191191
String controlXml = "<a>x<b/></a>";

xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testIsNotValidAgainst_withBrokenXml_andExternallyCreatedSchemaInstan
7979
@Test
8080
public void testIsValidAgainst_withBrokenXml_shouldFail() {
8181

82-
thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\nto be valid but found following problems:\\n.*");
82+
thrown.expectAssertionErrorPattern("^(\\r\\n?|\\n)Expecting:(\\r\\n?|\\n) <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>(\\r\\n?|\\n)to be valid but found following problems:(\\r\\n?|\\n).*");
8383
thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
8484
" message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." +
8585
" One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected.");
@@ -167,8 +167,8 @@ public void testIsInvalid_withBrokenXml_shouldPass() {
167167
@Test
168168
public void testIsInvalid_shouldFail() {
169169

170-
thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*"
171-
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\nto be invalid");
170+
thrown.expectAssertionErrorPattern("^(\\r\\n?|\\n)Expecting:(\\r\\n?|\\n) <.*"
171+
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>(\\r\\n?|\\n)to be invalid");
172172

173173
StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml"));
174174

xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/CompareAssertAreIdenticalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void testAreIdentical_withIgnoreWhitespaceAndTextValue_shouldPass() {
185185
public void testAreIdentical_withIgnoreElementContentWhitespace_shouldFailed() {
186186

187187
thrown.expectAssertionError("Expecting:%n <control instance> and <test instance> to be identical");
188-
thrown.expectAssertionError("Expected text value 'x' but was '%nx '");
188+
thrown.expectAssertionError("Expected text value 'x' but was '\nx '");
189189

190190
String testXml = String.format("<a>%nx <b/>%n</a>");
191191
String controlXml = "<a>x<b/></a>";

xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValidationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testIsNotValidAgainst_withBrokenXml_andExternallyCreatedSchemaInstan
7979
@Test
8080
public void testIsValidAgainst_withBrokenXml_shouldFail() {
8181

82-
thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\nto be valid but found following problems:\\n.*");
82+
thrown.expectAssertionErrorPattern("^\\RExpecting:\\R <.*" + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "invalidBook.xml>\\Rto be valid but found following problems:\\R.*");
8383
thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
8484
" message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." +
8585
" One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected.");
@@ -167,8 +167,8 @@ public void testIsInvalid_withBrokenXml_shouldPass() {
167167
@Test
168168
public void testIsInvalid_shouldFail() {
169169

170-
thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*"
171-
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\nto be invalid");
170+
thrown.expectAssertionErrorPattern("^\\RExpecting:\\R <.*"
171+
+ Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\Rto be invalid");
172172

173173
StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml"));
174174

0 commit comments

Comments
 (0)