From: aclement Date: Fri, 4 Aug 2006 11:03:08 +0000 (+0000) Subject: better diagnostic message. X-Git-Tag: pre_pr_153572~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=54c52c8ecd8ae73d254b4f545a56f7210b122e9f;p=aspectj.git better diagnostic message. --- diff --git a/testing/newsrc/org/aspectj/testing/OutputSpec.java b/testing/newsrc/org/aspectj/testing/OutputSpec.java index edc870022..d45208af8 100644 --- a/testing/newsrc/org/aspectj/testing/OutputSpec.java +++ b/testing/newsrc/org/aspectj/testing/OutputSpec.java @@ -41,19 +41,23 @@ public class OutputSpec { break; } } - } + } else { lineNo = -1; } if (!matches) { StringBuffer failMessage = new StringBuffer(); - failMessage.append("Expecting output:\n"); + failMessage.append("\n expecting output:\n"); + int l = 0; for (Iterator iter = expectedOutputLines.iterator(); iter.hasNext();) { String line = (String) iter.next(); failMessage.append(line); failMessage.append("\n"); } - failMessage.append("But found output:\n"); + failMessage.append(" but found output:\n"); failMessage.append(output); failMessage.append("\n"); - failMessage.append("First difference is on line " + lineNo); + if (lineNo==-1) + failMessage.append("Expected "+expectedOutputLines.size()+" lines of output but there are "+strTok.countTokens()); + else + failMessage.append("First difference is on line " + lineNo); failMessage.append("\n"); AjcTestCase.fail(failMessage.toString()); }