mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
Initial round of Moshi docs.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* Copyright (C) 2008 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user