File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
core/src/test/scala/com/avsystem/commons/serialization/json Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,6 @@ class JsonStringInputOutputTest extends AnyFunSuite with SerializationTestUtils
6060 assert(resBuilder.result() == jsons)
6161 }
6262
63- test(" WrappedJson" ) {
64- val json = """ {"a": 123, "b": 3.14}"""
65- assert(JsonStringOutput .write(WrappedJson (json)) == json)
66- assert(JsonStringInput .read[WrappedJson ](json) == WrappedJson (json))
67- }
68-
6963 def roundtrip [T : GenCodec ](name : String )(values : T * )(implicit pos : Position ): Unit = {
7064 test(name) {
7165 val serialized = values.map(write[T ](_))
Original file line number Diff line number Diff line change 1+ package com .avsystem .commons
2+ package serialization .json
3+
4+ import com .avsystem .commons .serialization .{SimpleValueInput , SimpleValueOutput }
5+ import org .scalatest .funsuite .AnyFunSuite
6+ import org .scalatest .matchers .should .Matchers
7+
8+ class WrappedJsonTest extends AnyFunSuite with Matchers {
9+
10+ private val testJson = """ {"a": 123, "b": 3.14}"""
11+
12+ test(" WrappedJson with JSON input/output" ) {
13+ assert(JsonStringOutput .write(WrappedJson (testJson)) == testJson)
14+ assert(JsonStringInput .read[WrappedJson ](testJson) == WrappedJson (testJson))
15+ }
16+
17+ // SimpleValueInput/Output does not support RawJson marker
18+ test(" WrappedJson with plain input/output" ) {
19+ assert(SimpleValueOutput .write(WrappedJson (testJson)) == testJson)
20+ assert(SimpleValueInput .read[WrappedJson ](testJson) == WrappedJson (testJson))
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments