diff options
author | aclement <aclement> | 2006-08-04 11:03:08 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-08-04 11:03:08 +0000 |
commit | 54c52c8ecd8ae73d254b4f545a56f7210b122e9f (patch) | |
tree | 550f26debcc35a573a2101872eb5c26f053cd08c /testing | |
parent | 908b4054bff043f50d8bcf12afb6801e0d2913d4 (diff) | |
download | aspectj-54c52c8ecd8ae73d254b4f545a56f7210b122e9f.tar.gz aspectj-54c52c8ecd8ae73d254b4f545a56f7210b122e9f.zip |
better diagnostic message.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/newsrc/org/aspectj/testing/OutputSpec.java | 12 |
1 files changed, 8 insertions, 4 deletions
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()); } |