Skip to content

Commit

Permalink
add test (#7757)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgfraser authored Jan 27, 2023
1 parent 105766e commit f62e95b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core-tests/shared/src/test/scala/zio/ZIOSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,15 @@ object ZIOSpec extends ZIOBaseSpec {
executor <- ZIO.descriptor.map(_.executor)
} yield assert(executor)(equalTo(default))
effect.onExecutor(default)
},
test("effects are shifted back at next yield") {
val default = Runtime.defaultExecutor
val global =
Executor.fromExecutionContext(scala.concurrent.ExecutionContext.global)
for {
_ <- ZIO.unit.onExecutor(global)
executor <- ZIO.executor
} yield assert(executor)(equalTo(default))
}
),
suite("loop")(
Expand Down

0 comments on commit f62e95b

Please sign in to comment.