From 3a81319ca3db4592fa9d062d5a92ce0af3eeee2d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 26 Feb 2018 10:04:11 -0500 Subject: [PATCH] TextFileTest.tail failed on Windows when using a source checkout with Unix newlines. --- core/src/test/java/hudson/util/TextFileTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/hudson/util/TextFileTest.java b/core/src/test/java/hudson/util/TextFileTest.java index cb689a080f..b923cfd074 100644 --- a/core/src/test/java/hudson/util/TextFileTest.java +++ b/core/src/test/java/hudson/util/TextFileTest.java @@ -40,10 +40,9 @@ public class TextFileTest { public void tail() throws Exception { File f = tmp.newFile(); FileUtils.copyURLToFile(getClass().getResource("ascii.txt"), f); - + String whole = FileUtils.readFileToString(f); TextFile t = new TextFile(f); - String tailStr = "la, vitae interdum quam rutrum id." + System.lineSeparator(); - assertEquals(34 + System.lineSeparator().length(), tailStr.length()); + String tailStr = whole.substring(whole.length() - 34); assertEquals(tailStr, t.fastTail(tailStr.length())); } -- GitLab