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

issue with containg #190

Open
sarahBuisson opened this issue Nov 5, 2017 · 2 comments
Open

issue with containg #190

sarahBuisson opened this issue Nov 5, 2017 · 2 comments

Comments

@sarahBuisson
Copy link

sarahBuisson commented Nov 5, 2017

the line
assertThat(Arrays.asList(1,1), org.hamcrest.Matchers.contains(1));

fail.

@BlueIce
Copy link

BlueIce commented Nov 8, 2017

This is the intended behaviour. contains only matches if all parameters have a one-to-one correspondence to the list elements. So this would work:

assertThat(Arrays.asList(1,1), org.hamcrest.Matchers.contains(1, 1));

To check if the list has at least one element use

assertThat(Arrays.asList(1,1), org.hamcrest.Matchers.hasItem(1));

@hakanai
Copy link

hakanai commented Feb 8, 2018

#140 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants