提交 e94152df 编写于 作者: J Jesse Glick

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.
上级 c454eaac
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册