Avoiding printing anything unless there is actually a failure.

Also take advantage of JUnit’s ability to show the exact spot of a mismatch between two strings.
This commit is contained in:
Jesse Glick committed 2013-03-21 16:30:29 -04:00
1 parent c454eaacf4
commit e94152df33
1 file changed
+2 -3
@@ -176,10 +176,9 @@ public class CronTabTest {
/**
* Humans can't easily see difference in two {@link Calendar}s, do help the diagnosis by using {@link DateFormat}.
*/
private void compare(Calendar a, Calendar b) {
private void compare(Calendar expected, Calendar actual) {
DateFormat f = DateFormat.getDateTimeInstance();
System.out.println(f.format(a.getTime())+" vs "+f.format(b.getTime()));
assertEquals(a,b);
assertEquals(f.format(expected.getTime()), f.format(actual.getTime()));
}
@Test