mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Merge pull request #695 from square/jwilson.0927.dollar
Don't use @Language when the literal includes a dollar sign
This commit is contained in:
@@ -65,14 +65,12 @@ class GeneratedAdaptersTest {
|
||||
val adapter = moshi.adapter(JsonAnnotationWithDollarSign::class.java)
|
||||
|
||||
// Read
|
||||
@Language("JSON")
|
||||
val json = "{\"\$foo\": \"bar\"}"
|
||||
|
||||
val instance = adapter.fromJson(json)!!
|
||||
assertThat(instance.bar).isEqualTo("bar")
|
||||
|
||||
// Write
|
||||
@Language("JSON")
|
||||
val expectedJson = "{\"\$foo\":\"baz\"}"
|
||||
|
||||
assertThat(adapter.toJson(JsonAnnotationWithDollarSign("baz"))).isEqualTo(expectedJson)
|
||||
|
Reference in New Issue
Block a user