ObjectArrayAssert.containsExactly() works wrong #131

orionll opened this Issue Dec 12, 2012 · 2 comments

2 participants

String[] arr = {"a", "b", "c"};
assertThat(arr).containsExactly("a", "b", "c"); // throws AssertionError

java.lang.AssertionError: expected:
<'['a', 'b', 'c'] (ArrayList@1ecc1)'>
but was:
<'['a', 'b', 'c'] (String[]@787bb290)'>


Thanks for reporting this, I have to say we screwed up this one :(

This will be fixed for 2.0, in the meantime use containsSequence instead, it is logically equivalent to containsExactly if the given sequence has the same size as the actual array.


fixed in 2.0M9 branch.
I'm not closing this issue because it must be merged in master branch where a major rework for 2.0 is being done, merge will happen after the rework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment