freepascal / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

using eq() with autounboxed Integer/Long can give confusing errors #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
public void withLong(Long longie) {
}

mock.withLong(new Long(10));
//fails with confusing description: "wanted: withLong(10), got: withLong(10)"
verify(mock.withLong(eq(10)));
//works fine:
verify(mock.withLong(eq(10L)));

Original issue reported on code.google.com by szcze...@gmail.com on 9 Jun 2009 at 2:53

GoogleCodeExporter commented 9 years ago
Fixed in trunk.

The error description now adds type information when types don't match and 
toString()
is the same:

"wanted: withLong((Long) 10), got: withLong((Integer) 10)"

Original comment by szcze...@gmail.com on 9 Jun 2009 at 2:55

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 9 Jun 2009 at 2:55

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 9 Jun 2009 at 3:15