SPIGOT-4815: Location.equals() not working
By: md_5 <git@md-5.net>
This commit is contained in:
parent
dc652253ed
commit
4c0157d6de
3 changed files with 79 additions and 4 deletions
|
@ -176,12 +176,21 @@ public class LocationTest {
|
|||
assertThat(vector.getZ(), is(closeTo(z, delta)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEquals() {
|
||||
Location first = getLocation().add(getVector());
|
||||
Location second = getLocation().add(getVector());
|
||||
|
||||
assertThat(first.hashCode(), is(second.hashCode()));
|
||||
assertThat(first, is(second));
|
||||
}
|
||||
|
||||
private Vector getVector() {
|
||||
return new Vector(x, y, z);
|
||||
}
|
||||
|
||||
private static Location getEmptyLocation() {
|
||||
return new Location(null, 0, 0, 0);
|
||||
return new Location(TestWorld.INSTANCE, 0, 0, 0);
|
||||
}
|
||||
|
||||
private Location getLocation() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue