From ffdf0e70125420e4263f9d1f32a38a09b087f93c Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Thu, 2 Sep 2010 00:10:26 +0000 Subject: [PATCH] Fix some test problems. JsonWriter was using suboptimal escape characters for newlines etc: unicode escapes rather than \x escapes. JsonObjectTest was banning empty and whitespace-only keys. These values are permitted as of r585. --- gson/src/test/java/com/google/gson/JsonParserTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gson/src/test/java/com/google/gson/JsonParserTest.java b/gson/src/test/java/com/google/gson/JsonParserTest.java index 47409259..2564ca8e 100644 --- a/gson/src/test/java/com/google/gson/JsonParserTest.java +++ b/gson/src/test/java/com/google/gson/JsonParserTest.java @@ -17,13 +17,11 @@ package com.google.gson; import com.google.gson.common.TestTypes.BagOfPrimitives; - import com.google.gson.stream.JsonReader; -import junit.framework.TestCase; - import java.io.CharArrayReader; import java.io.CharArrayWriter; import java.io.StringReader; +import junit.framework.TestCase; /** * Unit test for {@link JsonParser} @@ -89,8 +87,8 @@ public class JsonParserTest extends TestCase { JsonReader parser = new JsonReader(reader); parser.setLenient(true); - JsonElement element1 = GsonReader.parse(parser); - JsonElement element2 = GsonReader.parse(parser); + JsonElement element1 = Streams.parse(parser); + JsonElement element2 = Streams.parse(parser); BagOfPrimitives actualOne = gson.fromJson(element1, BagOfPrimitives.class); assertEquals("one", actualOne.stringValue); BagOfPrimitives actualTwo = gson.fromJson(element2, BagOfPrimitives.class);