alexruiz / fest-assert-2.x

FEST Fluent Assertions 2.x
http://fest.easytesting.org
Apache License 2.0
402 stars 69 forks source link

ObjectArrayAssert.containsExactly() works wrong #131

Open orionll opened 11 years ago

orionll commented 11 years ago
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)'>

joel-costigliola commented 11 years ago

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 commented 11 years ago

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.