Added a nice toString to IntegerArgumentType
This commit is contained in:
@@ -10,6 +10,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static net.minecraft.commands.arguments.IntegerArgumentType.integer;
|
||||
import static org.hamcrest.Matchers.hasToString;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
@@ -76,4 +77,12 @@ public class IntegerArgumentTypeTest {
|
||||
.addEqualityGroup(integer(-50, 100), integer(-50, 100))
|
||||
.testEquals();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToString() throws Exception {
|
||||
assertThat(integer(), hasToString("integer()"));
|
||||
assertThat(integer(-100), hasToString("integer(-100)"));
|
||||
assertThat(integer(-100, 100), hasToString("integer(-100, 100)"));
|
||||
assertThat(integer(Integer.MIN_VALUE, 100), hasToString("integer(-2147483648, 100)"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user