From aea577073fb21a3abae14915dc7c556e13592c16 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 16 Jun 2024 21:57:31 +0200 Subject: [PATCH] Reformat with scalafmt 3.8.2 Executed command: scalafmt --non-interactive --- .../libs/json/JsonMemoryFootprintSpec.scala | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/play-json/jvm/src/test/scala-3/play/api/libs/json/JsonMemoryFootprintSpec.scala b/play-json/jvm/src/test/scala-3/play/api/libs/json/JsonMemoryFootprintSpec.scala index 1ac2b98d..06f53117 100644 --- a/play-json/jvm/src/test/scala-3/play/api/libs/json/JsonMemoryFootprintSpec.scala +++ b/play-json/jvm/src/test/scala-3/play/api/libs/json/JsonMemoryFootprintSpec.scala @@ -13,8 +13,14 @@ class JsonMemoryFootprintSpec extends AnyFreeSpec { "Json.parse" - { "obj0" in assertSizes("""{}""", 16, 16) - "obj1" in assertSizes("""{"1":true}""", 152, 168, expectedJdk21 = Some(160), hashedJdk21 = Some(184)) - "obj4" in assertSizes("""{"1":true,"2":true,"3":true,"4":true}""", 296, 312, expectedJdk21 = Some(304), hashedJdk21 = Some(328)) + "obj1" in assertSizes("""{"1":true}""", 152, 168, expectedJdk21 = Some(160), hashedJdk21 = Some(184)) + "obj4" in assertSizes( + """{"1":true,"2":true,"3":true,"4":true}""", + 296, + 312, + expectedJdk21 = Some(304), + hashedJdk21 = Some(328) + ) "arr0" in assertSizes("""[]""", 40, 40) "arr1" in assertSizes("""[true]""", 120, 120) @@ -45,13 +51,19 @@ class JsonMemoryFootprintSpec extends AnyFreeSpec { def arr1KB(elem: String, targetSize: Int = 1000): String = Iterator.continually(elem).take(targetSize / (elem.length + 1)).mkString("[", ",", "]") "obj0" in assertSizes(arr1KB("{}"), 7432, 7432) - "obj1" in assertSizes(arr1KB("""{"a":6}"""), 29568, 31568, expectedJdk21 = Some(30568), hashedJdk21 = Some(33568)) + "obj1" in assertSizes(arr1KB("""{"a":6}"""), 29568, 31568, expectedJdk21 = Some(30568), hashedJdk21 = Some(33568)) "nums" in assertSizes(arr1KB("6"), 42104, 42104) "arr0" in assertSizes(arr1KB("[]"), 15424, 15424) "arr1" in assertSizes(arr1KB("[6]"), 51080, 51080) } - private def assertSizes(input: String, expected: Long, hashed: Long, expectedJdk21: Option[Long] = None, hashedJdk21: Option[Long] = None) = { + private def assertSizes( + input: String, + expected: Long, + hashed: Long, + expectedJdk21: Option[Long] = None, + hashedJdk21: Option[Long] = None + ) = { assertSize(Json.parse(input), expected, expectedJdk21) withClue("After hashCode():")( assertSize(