From 544f836d7e9b18e85b7a8940d06fd3538706dbf7 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 14 Mar 2021 14:44:14 +0700 Subject: [PATCH] Fix OutputSpec corner case (test empty output) from @052bd66f Signed-off-by: Alexander Kriegisch --- testing/src/test/java/org/aspectj/testing/OutputSpec.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/src/test/java/org/aspectj/testing/OutputSpec.java b/testing/src/test/java/org/aspectj/testing/OutputSpec.java index 9d334386a..f8c96077f 100644 --- a/testing/src/test/java/org/aspectj/testing/OutputSpec.java +++ b/testing/src/test/java/org/aspectj/testing/OutputSpec.java @@ -123,6 +123,7 @@ public class OutputSpec { private String[] getTrimmedLines(String text) { // Remove leading/trailing empty lines and leading/trailing whitespace from each line - return text.trim().split("\\s*\n\\s*"); + String[] trimmedLines = text.trim().split("\\s*\n\\s*"); + return trimmedLines.length == 1 && trimmedLines[0].equals("") ? new String[0] : trimmedLines; } } -- 2.39.5