mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
Don't use @Language when the literal includes a dollar sign
It makes IntelliJ grumpy. https://youtrack.jetbrains.com/issue/KT-27224
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