From 3818b71d8ef4502ea7fa9ce8b45bce3b8f22d7a7 Mon Sep 17 00:00:00 2001 From: diffblue-assistant Date: Tue, 16 Oct 2018 15:12:49 +0100 Subject: [PATCH] Add unit tests for StringReader.isAllowedInUnquotedString These tests were written by Diffblue Deeptest. --- .../mojang/brigadier/StringReaderTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/java/com/mojang/brigadier/StringReaderTest.java b/src/test/java/com/mojang/brigadier/StringReaderTest.java index 0bcb752..d42bd37 100644 --- a/src/test/java/com/mojang/brigadier/StringReaderTest.java +++ b/src/test/java/com/mojang/brigadier/StringReaderTest.java @@ -8,7 +8,9 @@ import org.junit.Test; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class StringReaderTest { @@ -527,4 +529,24 @@ public class StringReaderTest { assertThat(ex.getCursor(), is(0)); } } + + @Test + public void isAllowedInUnquotedStringInput2OutputTrue() { + assertTrue(StringReader.isAllowedInUnquotedString('2')); + } + + @Test + public void isAllowedInUnquotedStringInputNotNullOutputFalse() { + assertFalse(StringReader.isAllowedInUnquotedString('\u0000')); + } + + @Test + public void isAllowedInUnquotedStringInputNotNullOutputFalse2() { + assertFalse(StringReader.isAllowedInUnquotedString(':')); + } + + @Test + public void isAllowedInUnquotedStringInputrOutputTrue() { + assertTrue(StringReader.isAllowedInUnquotedString('r')); + } } \ No newline at end of file