@@ -47,7 +47,6 @@ class MessagePackTest extends MessagePackSpec {
4747 }
4848 }
4949
50-
5150 " MessagePack" should {
5251 " detect fixint values" in {
5352
@@ -498,4 +497,42 @@ class MessagePackTest extends MessagePackSpec {
498497 }
499498
500499 }
500+
501+ " MessagePack.PackerConfig" should {
502+ " be immutable" in {
503+ val a = new MessagePack .PackerConfig ()
504+ val b = a.withBufferSize(64 * 1024 )
505+ a.equals(b) shouldBe false
506+ }
507+
508+ " implement equals" in {
509+ val a = new MessagePack .PackerConfig ()
510+ val b = new MessagePack .PackerConfig ()
511+ a.equals(b) shouldBe true
512+ a.withBufferSize(64 * 1024 ).equals(b) shouldBe false
513+ a.withSmallStringOptimizationThreshold(64 ).equals(b) shouldBe false
514+ a.withBufferFlushThreshold(64 * 1024 ).equals(b) shouldBe false
515+ }
516+ }
517+
518+ " MessagePack.UnpackerConfig" should {
519+ " be immutable" in {
520+ val a = new MessagePack .UnpackerConfig ()
521+ val b = a.withBufferSize(64 * 1024 )
522+ a.equals(b) shouldBe false
523+ }
524+
525+ " implement equals" in {
526+ val a = new MessagePack .UnpackerConfig ()
527+ val b = new MessagePack .UnpackerConfig ()
528+ a.equals(b) shouldBe true
529+ a.withBufferSize(64 * 1024 ).equals(b) shouldBe false
530+ a.withAllowReadingStringAsBinary(false ).equals(b) shouldBe false
531+ a.withAllowReadingBinaryAsString(false ).equals(b) shouldBe false
532+ a.withActionOnMalformedString(CodingErrorAction .REPORT ).equals(b) shouldBe false
533+ a.withActionOnUnmappableString(CodingErrorAction .REPORT ).equals(b) shouldBe false
534+ a.withStringSizeLimit(32 ).equals(b) shouldBe false
535+ a.withStringDecoderBufferSize(32 ).equals(b) shouldBe false
536+ }
537+ }
501538}
0 commit comments