mlinhard / mockito

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

compareTo returns 1 for the same object #467

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
@Test
    public void shouldCompareToTreatAsEqualMocksWithTheSameReferences() {
        //given
        Date today    = mock(Date.class);

        //when
        Set<Date> set = new TreeSet<Date>();
        set.add(today);
        set.add(today);

        //then
        assertEquals(1, set.size());
    }

What is the expected output? What do you see instead?
Test passes

What version of the product are you using? On what operating system?
Windows/Linux x66 jdk1.7

Please provide any additional information below.
comapreTo should take into account reference equality

Original issue reported on code.google.com by albers...@gmail.com on 7 Jan 2014 at 11:53

GoogleCodeExporter commented 9 years ago
Fix in https://github.com/mockito/mockito/pull/32
Please review and merge if everything is ok.

Original comment by albers...@gmail.com on 7 Jan 2014 at 11:59

GoogleCodeExporter commented 9 years ago
Looks good, once you've finished your modifications I'll merge it.

Original comment by brice.du...@gmail.com on 8 Jan 2014 at 1:10

GoogleCodeExporter commented 9 years ago
Please close it as solution is alreadz merged into master

Original comment by albers...@gmail.com on 10 Jan 2014 at 12:48

GoogleCodeExporter commented 9 years ago
Fixed in the PR, thanks by teh way ;)

Original comment by brice.du...@gmail.com on 20 Jan 2014 at 5:21

GoogleCodeExporter commented 9 years ago
Issue 338 has been merged into this issue.

Original comment by brice.du...@gmail.com on 22 Jan 2014 at 5:37

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 16 Aug 2014 at 2:43

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 24 Aug 2014 at 3:14

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 24 Aug 2014 at 3:50