fest-assert-2.x icon indicating copy to clipboard operation
fest-assert-2.x copied to clipboard

ObjectArrayAssert.containsExactly() works wrong

Open orionll opened this issue 12 years ago • 2 comments

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)'>

orionll avatar Dec 12 '12 09:12 orionll

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.

joel-costigliola avatar Dec 12 '12 17:12 joel-costigliola

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.

joel-costigliola avatar Feb 24 '13 10:02 joel-costigliola