From bf020092ca9f0338915187009b9982175aa1ee1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Thu, 23 Jan 2025 12:10:28 +0200 Subject: [PATCH] Pay attention to system.lineseparator in XML formatter tests Use the helper method to unify on the system line separator. --- .../ui/editor/formatter/XmlDocumentFormatterTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/formatter/XmlDocumentFormatterTest.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/formatter/XmlDocumentFormatterTest.java index 7511187d9fe..c72fe0dc22c 100644 --- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/formatter/XmlDocumentFormatterTest.java +++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/formatter/XmlDocumentFormatterTest.java @@ -94,8 +94,12 @@ private void simpleTest(String sourceFileName, String targetFileName, Formatting XmlDocumentFormatter xmlFormatter = new XmlDocumentFormatter(); xmlFormatter.setDefaultLineDelimiter(System.lineSeparator()); - String result = xmlFormatter.format(Files.readString(getBuildFile(sourceFileName).toPath()), prefs); - String expectedResult = Files.readString(getBuildFile(targetFileName).toPath()); + // file content read via the helper method as it unifies the line separator to + // the system one + String result = xmlFormatter.format( + getReaderContentAsString(Files.newBufferedReader(getBuildFile(sourceFileName).toPath())), prefs); + String expectedResult = getReaderContentAsString( + Files.newBufferedReader((getBuildFile(targetFileName).toPath()))); assertEquals(expectedResult, result); }