From f9992048955ff28c42dfcb42251e78ef251e4864 Mon Sep 17 00:00:00 2001 From: 47erbot Date: Mon, 30 Aug 2021 05:06:17 +0000 Subject: [PATCH 1/2] Update scalafmt-core to 3.0.1 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index e9516571..33356e0f 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.0.0 +version = 3.0.1 style = defaultWithAlign maxColumn = 100 From fdae9ef2169ae84ddca7ff9c96bd8d2f0d6c90c8 Mon Sep 17 00:00:00 2001 From: 47erbot Date: Mon, 30 Aug 2021 05:06:25 +0000 Subject: [PATCH 2/2] Reformat with scalafmt 3.0.1 --- fetch-debug/src/main/scala/debug.scala | 8 +- .../src/test/scala/GithubExample.scala | 4 +- .../src/test/scala/GraphQLExample.scala | 8 +- .../src/test/scala/JedisExample.scala | 12 +-- fetch/src/main/scala/cache.scala | 4 +- fetch/src/main/scala/fetch.scala | 8 +- fetch/src/test/scala/FetchBatchingTests.scala | 28 ++--- .../src/test/scala/FetchReportingTests.scala | 32 +++--- fetch/src/test/scala/FetchTests.scala | 100 +++++++++--------- 9 files changed, 102 insertions(+), 102 deletions(-) diff --git a/fetch-debug/src/main/scala/debug.scala b/fetch-debug/src/main/scala/debug.scala index 64bb9a23..93d6c4ad 100644 --- a/fetch-debug/src/main/scala/debug.scala +++ b/fetch-debug/src/main/scala/debug.scala @@ -39,17 +39,17 @@ object debug { def firstRequest(r: Round): Option[Long] = for { aQuery <- r.queries.headOption - firstR = r.queries.foldLeft(aQuery.start)({ case (acc, q) => + firstR = r.queries.foldLeft(aQuery.start) { case (acc, q) => acc min q.start - }) + } } yield firstR def lastRequest(r: Round): Option[Long] = for { aQuery <- r.queries.headOption - lastR = r.queries.foldLeft(aQuery.end)({ case (acc, q) => + lastR = r.queries.foldLeft(aQuery.end) { case (acc, q) => acc max q.end - }) + } } yield lastR def showLog(log: Log): Document = diff --git a/fetch-examples/src/test/scala/GithubExample.scala b/fetch-examples/src/test/scala/GithubExample.scala index 02999ae3..ccbd78b2 100644 --- a/fetch-examples/src/test/scala/GithubExample.scala +++ b/fetch-examples/src/test/scala/GithubExample.scala @@ -197,9 +197,9 @@ class GithubExample extends AnyWordSpec with Matchers { case class Project(repo: Repo, contributors: List[Contributor], languages: List[Language]) def fetchProject[F[_]: Async](repo: Repo): Fetch[F, Project] = - (repoContributors(repo), repoLanguages(repo)).mapN({ case (contribs, langs) => + (repoContributors(repo), repoLanguages(repo)).mapN { case (contribs, langs) => Project(repo = repo, contributors = contribs, languages = langs) - }) + } def fetchOrg[F[_]: Async](org: String) = for { diff --git a/fetch-examples/src/test/scala/GraphQLExample.scala b/fetch-examples/src/test/scala/GraphQLExample.scala index 48b48065..32574669 100644 --- a/fetch-examples/src/test/scala/GraphQLExample.scala +++ b/fetch-examples/src/test/scala/GraphQLExample.scala @@ -232,19 +232,19 @@ class GraphQLExample extends AnyWordSpec with Matchers { object Parsers { def queryParser: Parser[OrganizationQuery] = - rawParser.map({ case (o, n) => + rawParser.map { case (o, n) => OrganizationQuery( o, - n.map({ case (i, name, langs, colls) => + n.map { case (i, name, langs, colls) => RepositoriesQuery( i, if (name) Some(()) else None, if (langs) Some(LanguagesQuery()) else None, if (colls) Some(CollaboratorsQuery()) else None ) - }) + } ) - }) + } def rawParser: Parser[(String, Option[(Int, Boolean, Boolean, Boolean)])] = for { diff --git a/fetch-examples/src/test/scala/JedisExample.scala b/fetch-examples/src/test/scala/JedisExample.scala index 7eb96f98..aa738af7 100644 --- a/fetch-examples/src/test/scala/JedisExample.scala +++ b/fetch-examples/src/test/scala/JedisExample.scala @@ -96,13 +96,13 @@ object Binary { ): F[ByteArray] = { byteOutputStream .mproduct(outputStream(_)) - .use({ case (byte, out) => + .use { case (byte, out) => S.delay { out.writeObject(obj) out.flush() byte.toByteArray } - }) + } } def deserialize[F[_], A](bin: ByteArray)(implicit @@ -110,12 +110,12 @@ object Binary { ): F[Option[A]] = { byteInputStream(bin) .mproduct(inputStream(_)) - .use({ case (byte, in) => + .use { case (byte, in) => S.delay { val obj = in.readObject() Try(obj.asInstanceOf[A]).toOption } - }) + } } } @@ -159,9 +159,9 @@ case class RedisCache[F[_]: Sync](host: String) extends DataCache[F] { M: Monad[F] ): F[DataCache[F]] = for { - bin <- vs.traverse({ case (id, v) => + bin <- vs.traverse { case (id, v) => Binary.serialize(v).tupleRight(cacheId(id, data)) - }) + } _ <- Sync[F].delay(bulkSet(bin)) } yield this diff --git a/fetch/src/main/scala/cache.scala b/fetch/src/main/scala/cache.scala index 63eaf7af..bd8b2d90 100644 --- a/fetch/src/main/scala/cache.scala +++ b/fetch/src/main/scala/cache.scala @@ -70,11 +70,11 @@ object InMemoryCache { InMemoryCache[F](Map.empty[(Data[Any, Any], DataSourceId), DataSourceResult]) def from[F[_]: Monad, I, A](results: ((Data[I, A], I), A)*): InMemoryCache[F] = - InMemoryCache[F](results.foldLeft(Map.empty[(Data[Any, Any], DataSourceId), DataSourceResult])({ + InMemoryCache[F](results.foldLeft(Map.empty[(Data[Any, Any], DataSourceId), DataSourceResult]) { case (acc, ((data, i), v)) => acc.updated( (data.asInstanceOf[Data[Any, Any]], new DataSourceId(i)), new DataSourceResult(v) ) - })) + }) } diff --git a/fetch/src/main/scala/fetch.scala b/fetch/src/main/scala/fetch.scala index a1401807..d8591539 100644 --- a/fetch/src/main/scala/fetch.scala +++ b/fetch/src/main/scala/fetch.scala @@ -240,9 +240,9 @@ object `package` { .get(dsId) .fold( (ds, blocked) - )({ case (d, req) => + ) { case (d, req) => (d, combineRequests(blocked, req)) - }) + } acc.updated(dsId, combined) } ) @@ -601,9 +601,9 @@ object `package` { requests <- FetchExecution.parallel( NonEmptyList .fromListUnsafe(blocked) - .map({ case (ds, req) => + .map { case (ds, req) => runBlockedRequest(req, ds, cache, log) - }) + } ) performedRequests = requests.foldLeft(List.empty[Request])(_ ++ _) _ <- diff --git a/fetch/src/test/scala/FetchBatchingTests.scala b/fetch/src/test/scala/FetchBatchingTests.scala index 8b394d15..a686e9ea 100644 --- a/fetch/src/test/scala/FetchBatchingTests.scala +++ b/fetch/src/test/scala/FetchBatchingTests.scala @@ -109,12 +109,12 @@ class FetchBatchingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3, 4, 5) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 5 totalBatches(log.rounds) shouldEqual 3 - }).unsafeToFuture() + }.unsafeToFuture() } "A large fetch to a datasource with a maximum batch size is split and executed in parallel" in { @@ -123,12 +123,12 @@ class FetchBatchingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3, 4, 5) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 5 totalBatches(log.rounds) shouldEqual 3 - }).unsafeToFuture() + }.unsafeToFuture() } "Fetches to datasources with a maximum batch size should be split and executed in parallel and sequentially when using productR" in { @@ -138,12 +138,12 @@ class FetchBatchingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3, 4, 5) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 5 + 5 totalBatches(log.rounds) shouldEqual 3 + 3 - }).unsafeToFuture() + }.unsafeToFuture() } "Fetches to datasources with a maximum batch size should be split and executed in parallel and sequentially when using productL" in { @@ -153,12 +153,12 @@ class FetchBatchingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3, 4, 5) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 5 + 5 totalBatches(log.rounds) shouldEqual 3 + 3 - }).unsafeToFuture() + }.unsafeToFuture() } "A large (many) fetch to a datasource with a maximum batch size is split and executed in sequence" in { @@ -167,12 +167,12 @@ class FetchBatchingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 3 totalBatches(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "A large (many) fetch to a datasource with a maximum batch size is split and executed in parallel" in { @@ -181,12 +181,12 @@ class FetchBatchingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 3 totalBatches(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Very deep fetches don't overflow stack or heap" in { @@ -203,8 +203,8 @@ class FetchBatchingTests extends FetchSpec { ids.toList.traverse(fetchBatchedDataBigId[IO]) ) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual ids.map(_.toString) - }).unsafeToFuture() + }.unsafeToFuture() } } diff --git a/fetch/src/test/scala/FetchReportingTests.scala b/fetch/src/test/scala/FetchReportingTests.scala index b8e70c3f..5b02c938 100644 --- a/fetch/src/test/scala/FetchReportingTests.scala +++ b/fetch/src/test/scala/FetchReportingTests.scala @@ -29,9 +29,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 0 - }).unsafeToFuture() + }.unsafeToFuture() } "Single fetches are executed in one round" in { @@ -40,9 +40,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch[IO]) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 1 - }).unsafeToFuture() + }.unsafeToFuture() } "Single fetches are executed in one round per binding in a for comprehension" in { @@ -54,9 +54,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Single fetches for different data sources are executed in multiple rounds if they are in a for comprehension" in { @@ -68,9 +68,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Single fetches combined with cartesian are run in one round" in { @@ -79,9 +79,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 1 - }).unsafeToFuture() + }.unsafeToFuture() } "Single fetches combined with traverse are run in one round" in { @@ -93,9 +93,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "The product of two fetches from the same data source implies batching" in { @@ -104,9 +104,9 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 1 - }).unsafeToFuture() + }.unsafeToFuture() } "The product of concurrent fetches of the same type implies everything fetched in batches" in { @@ -129,10 +129,10 @@ class FetchReportingTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => log.rounds.size shouldEqual 2 totalBatches(log.rounds) shouldEqual 1 totalFetched(log.rounds) shouldEqual 3 + 1 - }).unsafeToFuture() + }.unsafeToFuture() } } diff --git a/fetch/src/test/scala/FetchTests.scala b/fetch/src/test/scala/FetchTests.scala index 1a260cf7..93fb0752 100644 --- a/fetch/src/test/scala/FetchTests.scala +++ b/fetch/src/test/scala/FetchTests.scala @@ -148,10 +148,10 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual (1, 2) log.rounds.size shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Traversals are implicitly batched" in { @@ -163,10 +163,10 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(0, 1, 2) log.rounds.size shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Sequencing is implicitly batched" in { @@ -175,12 +175,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 3 totalBatches(log.rounds) shouldEqual 1 - }).unsafeToFuture() + }.unsafeToFuture() } "Identities are deduped when batched" in { @@ -190,14 +190,14 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual sources log.rounds.size shouldEqual 1 log.rounds.head.queries.size shouldEqual 1 log.rounds.head.queries.head.request should matchPattern { case Batch(NonEmptyList(1, List(2)), _) => } - }).unsafeToFuture() + }.unsafeToFuture() } "The product of two fetches implies parallel fetching" in { @@ -206,11 +206,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual (1, List(0, 1, 2)) log.rounds.size shouldEqual 1 log.rounds.head.queries.size shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Concurrent fetching calls batches only when it can" in { @@ -219,11 +219,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual (1, List(0, 1, 2)) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 0 - }).unsafeToFuture() + }.unsafeToFuture() } "Concurrent fetching performs requests to multiple data sources in parallel" in { @@ -232,11 +232,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual ((1, List(0, 1)), 3) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 0 - }).unsafeToFuture() + }.unsafeToFuture() } "The product of concurrent fetches implies everything fetched concurrently" in { @@ -251,12 +251,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual ((1, (2, 3)), 4) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 1 totalFetched(log.rounds) shouldEqual 4 - }).unsafeToFuture() + }.unsafeToFuture() } "The product of concurrent fetches of the same type implies everything fetched in a single batch" in { @@ -281,12 +281,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual ((1, 2), 3) log.rounds.size shouldEqual 2 totalBatches(log.rounds) shouldEqual 2 totalFetched(log.rounds) shouldEqual 5 - }).unsafeToFuture() + }.unsafeToFuture() } "Every level of joined concurrent fetches is combined and batched" in { @@ -307,12 +307,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual (1, 2) log.rounds.size shouldEqual 2 totalBatches(log.rounds) shouldEqual 2 totalFetched(log.rounds) shouldEqual 4 - }).unsafeToFuture() + }.unsafeToFuture() } "Every level of sequenced concurrent fetches is batched" in { @@ -338,12 +338,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual ((List(9, 10, 11), List(12, 13, 14)), List(15, 16, 17)) log.rounds.size shouldEqual 3 totalBatches(log.rounds) shouldEqual 3 totalFetched(log.rounds) shouldEqual 9 + 4 + 6 - }).unsafeToFuture() + }.unsafeToFuture() } "The product of two fetches from the same data source implies batching" in { @@ -351,12 +351,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual (1, 3) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 1 totalFetched(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Sequenced fetches are run concurrently" in { @@ -365,11 +365,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3, 4, 5) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Sequenced fetches are deduped" in { @@ -378,12 +378,12 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 1) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 1 totalFetched(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Traversals are batched" in { @@ -392,11 +392,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 3) log.rounds.size shouldEqual 1 totalBatches(log.rounds) shouldEqual 1 - }).unsafeToFuture() + }.unsafeToFuture() } "Duplicated sources are only fetched once" in { @@ -405,11 +405,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 1) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Sources that can be fetched concurrently inside a for comprehension will be" in { @@ -421,11 +421,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual List(1, 2, 1) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Pure Fetches allow to explore further in the Fetch" in { @@ -440,11 +440,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual (1, 5) log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } // Caching @@ -464,10 +464,10 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual 2 totalFetched(log.rounds) shouldEqual 3 - }).unsafeToFuture() + }.unsafeToFuture() } "Batched elements are cached and thus not fetched more than once" in { @@ -485,11 +485,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual 2 log.rounds.size shouldEqual 1 totalFetched(log.rounds) shouldEqual 3 - }).unsafeToFuture() + }.unsafeToFuture() } "Elements that are cached won't be fetched" in { @@ -514,11 +514,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch, cache) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual 2 totalFetched(log.rounds) shouldEqual 0 log.rounds.size shouldEqual 0 - }).unsafeToFuture() + }.unsafeToFuture() } "Fetch#run accepts a cache as the second (optional) parameter" in { @@ -568,9 +568,9 @@ class FetchTests extends FetchSpec { val io = Fetch.runCache[IO](fetch, cache) - io.map({ case (c, result) => + io.map { case (c, result) => result shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } "Fetch#runCache works without the optional cache parameter" in { @@ -588,9 +588,9 @@ class FetchTests extends FetchSpec { val io = Fetch.runCache[IO](fetch) - io.map({ case (c, result) => + io.map { case (c, result) => result shouldEqual 2 - }).unsafeToFuture() + }.unsafeToFuture() } case class ForgetfulCache[F[_]: Monad]() extends DataCache[F] { @@ -617,11 +617,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch, forgetfulCache) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual 2 log.rounds.size shouldEqual 7 totalFetched(log.rounds) shouldEqual 7 - }).unsafeToFuture() + }.unsafeToFuture() } "We can use a custom cache that discards elements together with concurrent fetches" in { @@ -639,11 +639,11 @@ class FetchTests extends FetchSpec { val io = Fetch.runLog[IO](fetch, forgetfulCache) - io.map({ case (log, result) => + io.map { case (log, result) => result shouldEqual 2 log.rounds.size shouldEqual 8 totalFetched(log.rounds) shouldEqual 10 - }).unsafeToFuture() + }.unsafeToFuture() } // Errors