package testkit
- Source
- package.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- testkit
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- trait ApplicativeErrorGenerators[F[_], E] extends ApplicativeGenerators[F]
- trait ApplicativeGenerators[F[_]] extends Generators1[F]
- trait AsyncGenerators[F[_]] extends GenTemporalGenerators[F, Throwable] with SyncGenerators[F]
- trait AsyncGeneratorsWithoutEvalShift[F[_]] extends GenTemporalGenerators[F, Throwable] with SyncGenerators[F]
- trait ClockGenerators[F[_]] extends Generators1[F]
- trait FreeSyncEq extends AnyRef
- trait GenK[F[_]] extends Serializable
- trait GenSpawnGenerators[F[_], E] extends MonadCancelGenerators[F, E]
- trait GenTemporalGenerators[F[_], E] extends GenSpawnGenerators[F, E] with ClockGenerators[F]
- trait Generators1[F[_]] extends Serializable
- trait MonadCancelGenerators[F[_], E] extends MonadErrorGenerators[F, E]
- trait MonadErrorGenerators[F[_], E] extends MonadGenerators[F] with ApplicativeErrorGenerators[F, E]
- trait MonadGenerators[F[_]] extends ApplicativeGenerators[F]
- trait OutcomeGenerators extends AnyRef
- trait ParallelFGenerators extends AnyRef
- trait SyncGenerators[F[_]] extends MonadErrorGenerators[F, Throwable] with ClockGenerators[F]
- trait SyncTypeGenerators extends AnyRef
- final class TestContext extends ExecutionContext
A scala.concurrent.ExecutionContext implementation that can simulate async boundaries and time passage, useful for law testing purposes.
A scala.concurrent.ExecutionContext implementation that can simulate async boundaries and time passage, useful for law testing purposes. This is intended primarily for datatype implementors. Most end-users will be better served by the
cats.effect.testkit.TestControl
utility, rather than usingTestContext
directly.Usage for simulating an
ExecutionContext
):implicit val ec = TestContext() ec.execute(new Runnable { def run() = println("task1") }) ex.execute(new Runnable { def run() = { println("outer") ec.execute(new Runnable { def run() = println("inner") }) } }) // Nothing executes until `tick` gets called ec.tick() // Testing the resulting state assert(ec.state.tasks.isEmpty) assert(ec.state.lastReportedFailure == None)
- final case class TestException(i: Int) extends Exception with Product with Serializable
- trait TestInstances extends AnyRef
Value Members
- object FreeSyncGenerators
- object OutcomeGenerators extends OutcomeGenerators
- object ParallelFGenerators extends ParallelFGenerators
- object PureConcGenerators
- object SyncTypeGenerators extends SyncTypeGenerators
- object TestContext
- object freeEval extends FreeSyncEq
- object pure