From cf0ed05d72754b5f620982552ab514acb66677e8 Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 9 Mar 2005 11:17:15 +0000 Subject: [PATCH] output line numbers in stdout/err comparisons from test harness --- testing/newsrc/org/aspectj/testing/OutputSpec.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/newsrc/org/aspectj/testing/OutputSpec.java b/testing/newsrc/org/aspectj/testing/OutputSpec.java index abeae90d2..be869bfbb 100644 --- a/testing/newsrc/org/aspectj/testing/OutputSpec.java +++ b/testing/newsrc/org/aspectj/testing/OutputSpec.java @@ -27,11 +27,13 @@ public class OutputSpec { public void matchAgainst(String output) { boolean matches = false; + int lineNo = 0; StringTokenizer strTok = new StringTokenizer(output,"\n"); if (strTok.countTokens() == expectedOutputLines.size()) { matches = true; for (Iterator iter = expectedOutputLines.iterator(); iter.hasNext();) { String line = (String) iter.next(); + lineNo++; String outputLine = strTok.nextToken().trim(); if (!line.equals(outputLine)) { matches = false; @@ -50,6 +52,8 @@ public class OutputSpec { failMessage.append("But found output:\n"); failMessage.append(output); failMessage.append("\n"); + failMessage.append("First difference is on line " + lineNo); + failMessage.append("\n"); AjcTestCase.fail(failMessage.toString()); } } -- 2.39.5