An Assertion[A]
is the result of running a test, which may be ignore,
success, or failure, with some message of type A
.
A default runnable spec that provides testable versions of all of the modules in ZIO (Clock, Random, etc).
An ExecutedSpec
is a spec that has been run to produce test results.
FailureDetails
keeps track of details relevant to failures.
A Gen[R, A]
represents a generator of values of type A
, which requires
an environment R
.
A Gen[R, A]
represents a generator of values of type A
, which requires
an environment R
. Generators may be random or deterministic.
A Predicate[A]
is capable of producing assertion results on an A
.
A Predicate[A]
is capable of producing assertion results on an A
. As a
proposition, predicates compose using logical conjuction and disjunction,
and can be negated.
A PredicateValue
keeps track of a predicate and a value, existentially
hiding the type.
A PredicateValue
keeps track of a predicate and a value, existentially
hiding the type. This is used internally by the library to provide useful
error messages in the event of test failures.
A RunnableSpec
has a main function and can be run by the JVM / Scala.js.
A sample is a single observation from a random variable, together with a stream of "shrinkings" used for minimization of "large" failures.
A Spec[L, T]
is the backbone of _ZIO Test_.
A Spec[L, T]
is the backbone of _ZIO Test_. Every spec is either a suite,
which contains other specs, or a test of type T
. All specs are annotated
with labels of type L
.
A TestAspect
is an aspect that can be weaved into specs.
A TestAspect
is an aspect that can be weaved into specs. You can think of
an aspect as a polymorphic function, capable of transforming one test into
another, possibly enlarging the environment or error type.
A TestAspectPoly
is a TestAspect
that is completely polymorphic,
having no requirements on error or environment.
A TestExecutor[L, T]
is capable of executing specs containing tests of
type T
, annotated with labels of type L
.
A TestReporter[L]
is capable of reporting test results annotated with
labels L
.
A TestRunner[R, E, L]
encapsulates all the logic necessary to run specs that
require an environment R
and may fail with an error E
, using labels of
type L
.
A TestRunner[R, E, L]
encapsulates all the logic necessary to run specs that
require an environment R
and may fail with an error E
, using labels of
type L
. Test runners require a test executor, a platform, and a reporter.
A ZSpec[R, E, L]
is the canonical spec for testing ZIO programs.
A ZSpec[R, E, L]
is the canonical spec for testing ZIO programs. The
spec's test type is a ZIO effect that requires an R
, might fail with
an E
, might succeed with a TestResult
, and whose nodes are
annotated with labels L
.
Adds syntax for adding aspects.
Adds syntax for adding aspects.
test("foo") { assert(42, equals(42)) } @@ ignore
A ZTest[R, E]
is an effectfully produced test that requires an R
and may fail with an E
.
A Runner
that provides a default testable environment.
Asserts the given value satisfies the given predicate.
Asserts the given effectfully-computed value satisfies the given predicate.
Checks the predicate holds for "sufficient" numbers of samples from the given random variable.
Checks the predicate holds for all values from the given random variable.
Checks the predicate holds for all values from the given random variable.
This is useful for deterministic Gen
that comprehensively explore all
possibilities in a given domain.
Checks the predicate holds for the specified number of samples from the given random variable.
Creates a failed test result with the specified runtime cause.
Builds a suite containing a number of other specs.
Builds a spec with a single pure test.
Builds a spec with a single effectful test.
_ZIO Test_ is a featherweight testing library for effectful programs.
The library imagines every spec as an ordinary immutable value, providing tremendous potential for composition. Thanks to tight integration with ZIO, specs can use resources (including those requiring disposal), have well- defined linear and parallel semantics, and can benefit from a host of ZIO combinators.