Skip to content

Commit

Permalink
fmt and fix Scala 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
kyri-petrou committed Jul 1, 2024
1 parent bddcb85 commit 02827c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions zio-query/shared/src/main/scala/zio/query/Cache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ abstract class Cache {
}

object Cache {

/**
* Constructs an empty cache.
*/
Expand Down
15 changes: 8 additions & 7 deletions zio-query/shared/src/test/scala/zio/query/ZQuerySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ object ZQuerySpec extends ZIOBaseSpec {
},
test("N + 1 on composed queries") {
for {
ref <- Ref.make(0)
ds = countingDs(ref)
query1 = identityDs.query(IdReq(1)).flatMap(i => ds.query(CountingReq(i)))
query2 = identityDs.query(IdReq(2)).flatMap(i => ds.query(CountingReq(i)))
res <- (query1 <~> query2).run
i <- ref.get
} yield assertTrue(i == 1, res == ("1", "2"))
ref <- Ref.make(0)
ds = countingDs(ref)
query1 = identityDs.query(IdReq(1)).flatMap(i => ds.query(CountingReq(i)))
query2 = identityDs.query(IdReq(2)).flatMap(i => ds.query(CountingReq(i)))
res <- (query1 <~> query2).run
i <- ref.get
expected = ("1", "2")
} yield assertTrue(i == 1, res == expected)
},
test("requests are cached per datasource") {
for {
Expand Down

0 comments on commit 02827c9

Please sign in to comment.