Initial round of Moshi docs.

This commit is contained in:
jwilson
2015-06-15 23:51:47 -04:00
parent 4f660d4d23
commit d01c5782c3
15 changed files with 463 additions and 7 deletions

View File

@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.squareup.moshi;
import java.io.ObjectStreamClass;

View File

@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.squareup.moshi;
import java.io.ObjectStreamException;

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@@ -658,7 +658,7 @@ public final class MoshiTest {
@Test public void primitiveArray() throws Exception {
Moshi moshi = new Moshi.Builder().build();
JsonAdapter<int[]> adapter = moshi.adapter(int[].class);
assertThat(adapter.toJson(new int[] {1, 2})).isEqualTo("[1,2]");
assertThat(adapter.toJson(new int[] { 1, 2 })).isEqualTo("[1,2]");
assertThat(adapter.fromJson("[2,3]")).containsExactly(2, 3);
}

View File

@@ -145,7 +145,7 @@ public final class PromoteNameToValueTest {
}
@Test public void readerUnusedPromotionDoesntPersist() throws Exception {
JsonReader reader = new JsonReader(new Buffer().writeUtf8("[{},{\"a\":5}]"));
JsonReader reader = newReader("[{},{\"a\":5}]");
reader.beginArray();
reader.beginObject();
reader.promoteNameToValue();