jocarreira / hamcrest

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

OrderingComparison is describing mismatches backwards #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Here's some actual text of a mismatch description when using 
lessThanOrEqual():

    Expected: a value equal to  or less than <8>
         but: <8> was greater than <10>

Took a look at OrderingComparison, looks like comparison is the culprit:
    private String comparison(int compare) {
        if (compare > 0) {
            return "less than";
        }
        else if (compare == 0) {
            return "equal to ";
        }
        else {
            return "greater than";
        }
    }

The comparisons in that function are inverted.

Original issue reported on code.google.com by lvale...@gmail.com on 23 Apr 2009 at 7:58

GoogleCodeExporter commented 8 years ago

Original comment by smgfree...@gmail.com on 25 Apr 2009 at 7:57

GoogleCodeExporter commented 8 years ago

Original comment by smgfree...@gmail.com on 25 Apr 2009 at 8:46

GoogleCodeExporter commented 8 years ago

Original comment by smgfree...@gmail.com on 21 May 2009 at 10:44

GoogleCodeExporter commented 8 years ago

Original comment by smgfree...@gmail.com on 21 May 2009 at 10:45