Skip to content

Commit 6d9be80

Browse files
authored
Fix testing of a custom codec for Long values
1 parent 24ed859 commit 6d9be80

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

jsoniter-scala-macros/shared/src/test/scala/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerSpec.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,14 +668,14 @@ class JsonCodecMakerSpec extends VerifyingSpec {
668668
}
669669

670670
def encodeValue(x: Long, out: JsonWriter): _root_.scala.Unit =
671-
if (x > 9007199254740992L || x < -9007199254740992L) out.writeValAsString(x)
671+
if (x > 4503599627370496L || x < -4503599627370496L) out.writeValAsString(x)
672672
else out.writeVal(x)
673673
}
674674
val codecOfLongList = make[List[Long]]
675-
verifyDeser(codecOfLongList, List(1L, 9007199254740992L, 9007199254740993L),
676-
"""["1",9007199254740992,"9007199254740993"]""")
677-
verifySer(codecOfLongList, List(1L, 9007199254740992L, 9007199254740993L),
678-
"""[1,9007199254740992,"9007199254740993"]""")
675+
verifyDeser(codecOfLongList, List(1L, 4503599627370496L, 4503599627370497L),
676+
"""["001",4503599627370496,"4503599627370497"]""")
677+
verifySer(codecOfLongList, List(1L, 4503599627370496L, 4503599627370497L),
678+
"""[1,4503599627370496,"4503599627370497"]""")
679679
}
680680
"serialize and deserialize outer types using custom value codecs for boolean type" in {
681681
implicit val customCodecOfBoolean: JsonValueCodec[_root_.scala.Boolean] = new JsonValueCodec[_root_.scala.Boolean] {

0 commit comments

Comments
 (0)