Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectArrayAssert.containsExactly() works wrong #131

Open
orionll opened this issue Dec 12, 2012 · 2 comments
Open

ObjectArrayAssert.containsExactly() works wrong #131

orionll opened this issue Dec 12, 2012 · 2 comments
Assignees
Labels

Comments

@orionll
Copy link

orionll commented Dec 12, 2012

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
Copy link
Contributor

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
Copy link
Contributor

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants