Skip to content

Commit bf02009

Browse files
committed
Pay attention to system.lineseparator in XML formatter tests
Use the helper method to unify on the system line separator.
1 parent 052dabe commit bf02009

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/formatter/XmlDocumentFormatterTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ private void simpleTest(String sourceFileName, String targetFileName, Formatting
9494

9595
XmlDocumentFormatter xmlFormatter = new XmlDocumentFormatter();
9696
xmlFormatter.setDefaultLineDelimiter(System.lineSeparator());
97-
String result = xmlFormatter.format(Files.readString(getBuildFile(sourceFileName).toPath()), prefs);
98-
String expectedResult = Files.readString(getBuildFile(targetFileName).toPath());
97+
// file content read via the helper method as it unifies the line separator to
98+
// the system one
99+
String result = xmlFormatter.format(
100+
getReaderContentAsString(Files.newBufferedReader(getBuildFile(sourceFileName).toPath())), prefs);
101+
String expectedResult = getReaderContentAsString(
102+
Files.newBufferedReader((getBuildFile(targetFileName).toPath())));
99103

100104
assertEquals(expectedResult, result);
101105
}

0 commit comments

Comments
 (0)