Added & tested equals() and hashCode() in IntegerArgumentType
This commit is contained in:
@@ -5,6 +5,7 @@ import net.minecraft.commands.context.CommandContextBuilder;
|
||||
import net.minecraft.commands.context.ParsedArgument;
|
||||
import net.minecraft.commands.exceptions.ArgumentValidationException;
|
||||
import net.minecraft.commands.exceptions.IllegalArgumentSyntaxException;
|
||||
import com.google.common.testing.EqualsTester;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -65,4 +66,14 @@ public class IntegerArgumentTypeTest {
|
||||
|
||||
assertThat(IntegerArgumentType.getInteger(context, "foo"), is(100));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEquals() throws Exception {
|
||||
new EqualsTester()
|
||||
.addEqualityGroup(integer(), integer())
|
||||
.addEqualityGroup(integer(-100, 100), integer(-100, 100))
|
||||
.addEqualityGroup(integer(-100, 50), integer(-100, 50))
|
||||
.addEqualityGroup(integer(-50, 100), integer(-50, 100))
|
||||
.testEquals();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user