REPO-1995 TransformerDebugTest appears to be failing because there are CRLF

even though the build agents are Linux.
This commit is contained in:
Alan Davis
2017-08-07 15:51:41 +01:00
parent 45d19296e7
commit 049526f4d1

View File

@@ -118,8 +118,8 @@ public class TransformerDebugTest
{
for (int i = actual.length-1; i >= 0; i--)
{
StringJoiner sj = new StringJoiner(System.lineSeparator());
String[] bits = actual[i].split(System.lineSeparator());
StringJoiner sj = new StringJoiner("\n");
String[] bits = actual[i].split("\n");
for (String bit: bits)
{
Pattern p = Pattern.compile("^[0-9.]*");
@@ -142,6 +142,15 @@ public class TransformerDebugTest
return actual;
}
private String[] stripCR(String[] actual)
{
for (int i = actual.length-1; i >= 0; i--)
{
actual[i] = actual[i].replaceAll(" \r", "");
}
return actual;
}
@Test
public void alf18373Test()
{
@@ -168,8 +177,8 @@ public class TransformerDebugTest
"0 --a) [---] transformer1<<Component>> > 50 KB\n"+
"0 --b) [---] transformer3<<Component>> > 50 KB\n"+
"0 --c) [---] transformer4<<Component>> > 50 KB\n"+
"0 Finished in NN ms Transformer NOT called\n"}, unnumbered(untimed(debug.getEntries(10))));
"0 Finished in NN ms Transformer NOT called"}, unnumbered(untimed(stripCR(debug.getEntries(10)))));
assertLogEntriesEquals(new String[] {
"0 pdf txt WARN 1.5 MB NN ms No transformers as file is > 50 KB"}, unnumbered(untimed(log.getEntries(10))));
"0 pdf txt WARN 1.5 MB NN ms No transformers as file is > 50 KB"}, unnumbered(untimed(stripCR(log.getEntries(10)))));
}
}