ollie314 / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

a bit confusing failure description #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
   @Test
   public void shouldDoBasicAssertionsWithHamcrest() throws Exception {
       List<Integer> list = Arrays.asList(1, 2, 3);
       MatcherAssert.assertThat(list, Matchers.hasItems(1, 4));
   }

The assertion obviously fails but the message produced by the matcher
is somewhat hard to understand:

Expected: (a collection containing <1> and a collection containing <4>)
    but: a collection containing <4> was <1>, was <2>, was <3>

Original issue reported on code.google.com by szcze...@gmail.com on 1 Jul 2009 at 6:54

GoogleCodeExporter commented 8 years ago
3 years ago???  Seriously???

Original comment by zefif...@gmail.com on 6 Sep 2011 at 9:59

GoogleCodeExporter commented 8 years ago
tagging

Original comment by t.denley on 12 May 2012 at 10:52

GoogleCodeExporter commented 8 years ago
I've committed a fix for this onto trunk -- see commit 
https://github.com/hamcrest/JavaHamcrest/commit/96e113d7995eac6725e4d5ec780560ca
8ff6ae49

Original comment by t.denley on 19 Jul 2012 at 7:29