]> source.dussan.org Git - aspectj.git/commitdiff
Fix OutputSpec corner case (test empty output) from @052bd66f
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 14 Mar 2021 07:44:14 +0000 (14:44 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 14 Mar 2021 07:44:14 +0000 (14:44 +0700)
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
testing/src/test/java/org/aspectj/testing/OutputSpec.java

index 9d334386aa11fc1f79c9d6d17bd3845eb2f4513d..f8c96077f7d781f6bc84daa18ae952ac2fea029a 100644 (file)
@@ -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;
        }
 }