Skip to content

Commit a318f5c

Browse files
author
Alejandro Gómez
committed
Test missing identities
1 parent 23b2c5f commit a318f5c

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

shared/src/test/scala/FetchTests.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,22 @@ class FetchTests extends FreeSpec with Matchers {
338338
}
339339
}
340340

341+
"If there is a missing identity in the left hand of a product the product will fail" in {
342+
val fetch: Fetch[(Int, List[Int])] = Fetch.join(Fetch(Never()), many(3))
343+
344+
intercept[FetchFailure[InMemoryCache]] {
345+
Fetch.run[Eval](fetch).value
346+
}
347+
}
348+
349+
"If there is a missing identity in the right hand of a product the product will fail" in {
350+
val fetch: Fetch[(List[Int], Int)] = Fetch.join(many(3), Fetch(Never()))
351+
352+
intercept[FetchFailure[InMemoryCache]] {
353+
Fetch.run[Eval](fetch).value
354+
}
355+
}
356+
341357
"The product of concurrent fetches implies everything fetched concurrently" in {
342358
val fetch = Fetch.join(
343359
Fetch.join(

0 commit comments

Comments
 (0)