Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tothpeti committed Sep 11, 2023
1 parent eaeb13b commit f5c159a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/shared/src/test/scala/fs2/concurrent/ChannelSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ class ChannelSuite extends Fs2Suite {

def racingSendOperations(channel: IO[Channel[IO, Int]]) = {
val expectedFirstCase = ((Right(()), Right(())), List(0, 1))
val expectedSecondCase = ((Right(()), Left(Channel.Closed)), List(1))
val expectedThirdCase = ((Left(Channel.Closed), Right(())), List(1))
val expectedSecondCase = ((Left(Channel.Closed), Right(())), List(1))

channel
.flatMap { ch =>
Expand All @@ -293,10 +292,8 @@ class ChannelSuite extends Fs2Suite {
.map {
case obtained @ ((Right(()), Right(())), List(0, 1)) =>
assertEquals(obtained, expectedFirstCase)
case obtained @ ((Right(()), Left(Channel.Closed)), List(1)) =>
assertEquals(obtained, expectedSecondCase)
case obtained @ ((Left(Channel.Closed), Right(())), List(1)) =>
assertEquals(obtained, expectedThirdCase)
assertEquals(obtained, expectedSecondCase)
case e => fail(s"An unknown test result: $e")
}
.replicateA_(if (isJVM) 1000 else 1)
Expand Down

0 comments on commit f5c159a

Please sign in to comment.