Added tests for JsonPrimitive object creation with a char type.
Suggestion from r321 code review.
This commit is contained in:
parent
cbc6b4d939
commit
17256b8ce5
|
@ -58,10 +58,14 @@ public class JsonPrimitiveTest extends TestCase {
|
||||||
|
|
||||||
public void testStringsAndChar() throws Exception {
|
public void testStringsAndChar() throws Exception {
|
||||||
JsonPrimitive json = new JsonPrimitive("abc");
|
JsonPrimitive json = new JsonPrimitive("abc");
|
||||||
|
|
||||||
assertTrue(json.isString());
|
assertTrue(json.isString());
|
||||||
assertEquals('a', json.getAsCharacter());
|
assertEquals('a', json.getAsCharacter());
|
||||||
assertEquals("abc", json.getAsString());
|
assertEquals("abc", json.getAsString());
|
||||||
|
|
||||||
|
json = new JsonPrimitive('z');
|
||||||
|
assertTrue(json.isString());
|
||||||
|
assertEquals('z', json.getAsCharacter());
|
||||||
|
assertEquals("z", json.getAsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExponential() throws Exception {
|
public void testExponential() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user