Adding test for equals

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1167669 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2011-09-11 05:06:14 +00:00
parent 1db449142a
commit dc3bef79c8
1 changed files with 6 additions and 0 deletions

View File

@ -50,4 +50,10 @@ public class ComparableComparatorTest {
cc.compare(new File("dir/file"), new File("dir/file2")) );
}
public void testEquals() {
assertEquals( "Same instance wasn't equal", ComparableComparator.INSTANCE, ComparableComparator.INSTANCE);
assertEquals( "Different instance wasn't equal", ComparableComparator.INSTANCE, new ComparableComparator());
assertFalse( "Null was equal", ComparableComparator.INSTANCE.equals(null) );
}
}