From fceabf0f0f293df0e91e32eaf389b595e1b8eec2 Mon Sep 17 00:00:00 2001 From: Baptiste Mathus Date: Sun, 1 Jan 2017 14:34:40 +0100 Subject: [PATCH] Fix test failing on Windows because of line feed assumption The line separator length was assumed to be 1 byte wide, although it could be 2 on some platforms (aka Windows). --- core/src/test/java/hudson/model/RunTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/hudson/model/RunTest.java b/core/src/test/java/hudson/model/RunTest.java index 58ce9a5b6e..eb27dc69c2 100644 --- a/core/src/test/java/hudson/model/RunTest.java +++ b/core/src/test/java/hudson/model/RunTest.java @@ -189,7 +189,8 @@ public class RunTest { for (int i = 1; i < 10; i++) { assertEquals("dummy" + (10+i), logLines.get(i)); } - assertEquals("[...truncated 68 B...]", logLines.get(0)); + int truncatedCount = 10* ("dummyN".length() + System.getProperty("line.separator").length()) - 2; + assertEquals("[...truncated "+truncatedCount+" B...]", logLines.get(0)); } @Test