Packages

p

zio

test

package 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.

import zio.test._
import zio.test.environment.Live
import zio.Clock.nanoTime
import Assertion.isGreaterThan

object MyTest extends DefaultRunnableSpec {
  def spec = suite("clock")(
    test("time is non-zero") {
      for {
        time <- Live.live(nanoTime)
      } yield assertTrue(time >= 0)
    }
  )
}
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. test
  2. CompileVariants
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package diff
  2. package environment

    The environment package contains testable versions of all the standard ZIO environment types through the TestClock, TestConsole, TestSystem, and TestRandom modules.

    The environment package contains testable versions of all the standard ZIO environment types through the TestClock, TestConsole, TestSystem, and TestRandom modules. See the documentation on the individual modules for more detail about using each of them.

    If you are using ZIO Test and extending RunnableSpec a TestEnvironment containing all of them will be automatically provided to each of your tests. Otherwise, the easiest way to use the test implementations in ZIO Test is by providing the TestEnvironment to your program.

    import zio.test.environment._
    
    myProgram.provideLayer(testEnvironment)

    Then all environmental effects, such as printing to the console or generating random numbers, will be implemented by the TestEnvironment and will be fully testable. When you do need to access the "live" environment, for example to print debugging information to the console, just use the live combinator along with the effect as your normally would.

    If you are only interested in one of the test implementations for your application, you can also access them a la carte through the make method on each module. Each test module requires some data on initialization. Default data is included for each as DefaultData.

    import zio.test.environment._
    
    myProgram.provideM(TestConsole.make(TestConsole.DefaultData))

    Finally, you can create a Test object that implements the test interface directly using the makeTest method. This can be useful when you want to access some testing functionality without using the environment type.

    import zio.test.environment._
    
    for {
      testRandom <- TestRandom.makeTest(TestRandom.DefaultData)
      n          <- testRandom.nextInt
    } yield n

    This can also be useful when you are creating a more complex environment to provide the implementation for test services that you mix in.

  3. package internal
  4. package laws

    The laws package provides functionality for describing laws as values.

    The laws package provides functionality for describing laws as values. The fundamental abstraction is a set of ZLaws[Caps, R]. These laws model the laws that instances having a capability of type Caps are expected to satisfy. A capability Caps[_] is an abstraction describing some functionality that is common across different data types and obeys certain laws. For example, we can model the capability of two values of a type being compared for equality as follows:

    trait Equal[-A] {
      def equal(a1: A, a2: A): Boolean
    }

    Definitions of equality are expected to obey certain laws:

    1. Reflexivity - a1 === a1 2. Symmetry - a1 === a2 ==> a2 === a1 3. Transitivity - (a1 === a2) && (a2 === a3) ==> (a1 === a3)

    These laws define what the capabilities mean and ensure that it is safe to abstract across different instances with the same capability.

    Using ZIO Test, we can represent these laws as values. To do so, we define each law using one of the ZLaws constructors. For example:

    val transitivityLaw = ZLaws.Laws3[Equal]("transitivityLaw") {
      def apply[A: Equal](a1: A, a2: A, a3: A): TestResult =
        ???
    }

    We can then combine laws using the + operator:

    val reflexivityLaw: = ???
    val symmetryLaw:    = ???
    
    val equalLaws = reflexivityLaw + symmetryLaw + transitivityLaw

    Laws have a run method that takes a generator of values of type A and checks that those values satisfy the laws. In addition, objects can extend ZLawful to provide an even more convenient syntax for users to check that instances satisfy certain laws.

    object Equal extends Lawful[Equal]
    
    object Hash extends Lawful[Hash]
    
    object Ord extends Lawful[Ord]
    
    checkAllLaws(Equal + Hash + Ord)(Gen.int)

    Note that capabilities compose seamlessly because of contravariance. We can combine laws describing different capabilities to construct a set of laws requiring that instances having all of the capabilities satisfy each of the laws.

  5. package magnolia
  6. package mock
  7. package poly
  8. package refined
  9. package render

Type Members

  1. abstract class AbstractRunnableSpec extends AnyRef
    Annotations
    @EnableReflectiveInstantiation()
  2. type Annotated[+A] = (A, TestAnnotationMap)

    An Annotated[A] contains a value of type A along with zero or more test annotations.

  3. trait Annotations extends Serializable

    The Annotations trait provides access to an annotation map that tests can add arbitrary annotations to.

    The Annotations trait provides access to an annotation map that tests can add arbitrary annotations to. Each annotation consists of a string identifier, an initial value, and a function for combining two values. Annotations form monoids and you can think of Annotations as a more structured logging service or as a super polymorphic version of the writer monad effect.

  4. sealed trait Arrow[-A, +B] extends AnyRef
  5. case class Assert(arrow: Arrow[Any, Boolean]) extends Product with Serializable
  6. type AssertResult = BoolAlgebra[AssertionValue]
  7. type AssertResultM = BoolAlgebraM[Any, Nothing, AssertionValue]
  8. final class Assertion[-A] extends AssertionM[A] with (=> A) => AssertResult

    An Assertion[A] is capable of producing assertion results on an A.

    An Assertion[A] is capable of producing assertion results on an A. As a proposition, assertions compose using logical conjunction and disjunction, and can be negated.

  9. sealed abstract class AssertionData extends AnyRef
  10. abstract class AssertionM[-A] extends AnyRef

    An AssertionM[A] is capable of producing assertion results on an A.

    An AssertionM[A] is capable of producing assertion results on an A. As a proposition, assertions compose using logical conjunction and disjunction, and can be negated.

  11. sealed abstract class AssertionMData extends AnyRef
  12. sealed trait AssertionResult extends AnyRef
  13. sealed abstract class AssertionValue extends AnyRef

    An AssertionValue keeps track of a assertion and a value, existentially hiding the type.

    An AssertionValue keeps track of a assertion 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.

  14. trait AssertionVariants extends AnyRef
  15. sealed abstract class BoolAlgebra[+A] extends Product with Serializable

    A BoolAlgebra[A] is a description of logical operations on values of type A.

  16. final case class BoolAlgebraM[-R, +E, +A](run: ZIO[R, E, BoolAlgebra[A]]) extends Product with Serializable
  17. trait CheckConstructor[Environment, In] extends AnyRef
  18. trait CheckConstructorLowPriority1 extends CheckConstructorLowPriority2
  19. trait CheckConstructorLowPriority2 extends CheckConstructorLowPriority3
  20. trait CheckConstructorLowPriority3 extends CheckConstructorLowPriority4
  21. trait CheckConstructorLowPriority4 extends CheckConstructorLowPriority5
  22. trait CheckConstructorLowPriority5 extends CheckConstructorLowPriority6
  23. trait CheckConstructorLowPriority6 extends CheckConstructorLowPriority7
  24. trait CheckConstructorLowPriority7 extends AnyRef
  25. trait CompileVariants extends AnyRef
  26. abstract class DefaultRunnableSpec extends RunnableSpec[test.environment.TestEnvironment, Any]

    A default runnable spec that provides testable versions of all of the modules in ZIO (Clock, Has[Random], etc).

  27. sealed abstract class Eql[A, B] extends AnyRef

    A value of type Eql[A, B] provides implicit evidence that two values with types A and B could potentially be equal, that is, that A is a subtype of B or B is a subtype of A.

    A value of type Eql[A, B] provides implicit evidence that two values with types A and B could potentially be equal, that is, that A is a subtype of B or B is a subtype of A.

    Annotations
    @implicitNotFound()
  28. sealed trait ErrorMessage extends AnyRef
  29. final case class ExecutedSpec[+E](caseValue: SpecCase[E, ExecutedSpec[E]]) extends Product with Serializable

    An ExecutedSpec is a spec that has been run to produce test results.

  30. case class FailureCase(errorMessage: Message, codeString: String, location: String, path: Chunk[(String, Any)], span: Span, nestedFailures: Chunk[FailureCase], result: Any) extends Product with Serializable
  31. final case class FailureDetails(assertion: ::[AssertionValue]) extends Product with Serializable

    FailureDetails keeps track of details relevant to failures.

  32. trait FunctionVariants extends AnyRef
  33. final case class Gen[-R, +A](sample: ZStream[R, Nothing, Option[Sample[R, A]]]) extends Product with Serializable

    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.

  34. sealed abstract class GenFailureDetails extends AnyRef

    GenFailureDetails keeps track of relevant information related to a failure in a generative test.

  35. trait GenZIO extends AnyRef
  36. trait PrettyPrintVersionSpecific extends AnyRef
  37. sealed trait Result[+A] extends AnyRef
  38. abstract class RunnableSpec[R, E] extends AbstractRunnableSpec

    A RunnableSpec has a main function and can be run by the JVM / Scala.js.

  39. final case class Sample[-R, +A](value: A, shrink: ZStream[R, Nothing, Option[Sample[R, A]]]) extends Product with Serializable

    A sample is a single observation from a random variable, together with a tree of "shrinkings" used for minimization of "large" failures.

  40. trait Sized extends Serializable
  41. class SmartAssertMacros extends AnyRef
  42. final case class SourceLocation(path: String, line: Int) extends Product with Serializable
  43. trait SourceLocationVariants extends AnyRef
  44. final case class Spec[-R, +E, +T](caseValue: SpecCase[R, E, T, Spec[R, E, T]]) extends SpecVersionSpecific[R, E, T] with Product with Serializable

    A Spec[R, E, T] is the backbone of _ZIO Test_.

    A Spec[R, E, 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 require an environment of type R and may potentially fail with an error of type E.

  45. class SpecLayerMacros extends LayerMacroUtils
  46. trait SuiteConstructor[In] extends AnyRef
  47. trait SuiteConstructorLowPriority1 extends SuiteConstructorLowPriority2
  48. trait SuiteConstructorLowPriority2 extends SuiteConstructorLowPriority3
  49. trait SuiteConstructorLowPriority3 extends SuiteConstructorLowPriority4
  50. trait SuiteConstructorLowPriority4 extends AnyRef
  51. final case class Summary(success: Int, fail: Int, ignore: Int, summary: String) extends Product with Serializable
  52. final class TestAnnotation[V] extends Serializable

    A type of annotation.

  53. final class TestAnnotationMap extends AnyRef

    An annotation map keeps track of annotations of different types.

  54. sealed abstract class TestAnnotationRenderer extends AnyRef

    A TestAnnotationRenderer knows how to render test annotations.

  55. final case class TestArgs(testSearchTerms: List[String], tagSearchTerms: List[String], testTaskPolicy: Option[String], testRenderer: Option[String], printSummary: Boolean) extends Product with Serializable
  56. abstract class TestAspect[+LowerR, -UpperR, +LowerE, -UpperE] extends AnyRef

    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.

  57. type TestAspectAtLeastR[R] = TestAspect[Nothing, R, Nothing, Any]

    A TestAspectAtLeast[R] is a TestAspect that requires at least an R in its environment.

  58. type TestAspectPoly = TestAspect[Nothing, Any, Nothing, Any]

    A TestAspectPoly is a TestAspect that is completely polymorphic, having no requirements on error or environment.

  59. trait TestConfig extends Serializable

    The TestConfig service provides access to default configuration settings used by ZIO Test, including the number of times to repeat tests to ensure they are stable, the number of times to retry flaky tests, the sufficient number of samples to check from a random variable, and the maximum number of shrinkings to minimize large failures.

  60. trait TestConstructor[-Environment, In] extends AnyRef
  61. trait TestConstructorLowPriority1 extends TestConstructorLowPriority2
  62. trait TestConstructorLowPriority2 extends TestConstructorLowPriority3
  63. trait TestConstructorLowPriority3 extends TestConstructorLowPriority4
  64. trait TestConstructorLowPriority4 extends TestConstructorLowPriority5
  65. trait TestConstructorLowPriority5 extends TestConstructorLowPriority6
  66. trait TestConstructorLowPriority6 extends TestConstructorLowPriority7
  67. trait TestConstructorLowPriority7 extends AnyRef
  68. abstract class TestExecutor[+R, E] extends AnyRef

    A TestExecutor[R, E] is capable of executing specs that require an environment R and may fail with an E.

  69. sealed abstract class TestFailure[+E] extends AnyRef
  70. trait TestLogger extends Serializable
  71. type TestReporter[-E] = (zio.Duration, ExecutedSpec[E]) => URIO[Has[TestLogger], Unit]

    A TestReporter[E] is capable of reporting test results with error type E.

  72. type TestResult = BoolAlgebra[AssertionResult]
  73. final case class TestRunner[R, E](executor: TestExecutor[R, E], runtimeConfig: RuntimeConfig = RuntimeConfig.makeDefault(), reporter: TestReporter[E] = DefaultTestReporter(TestRenderer.default, TestAnnotationRenderer.default)(ZTraceElement.empty), bootstrap: Layer[Nothing, Has[TestLogger] with Has[Clock]] = (Console.live.to(TestLogger.fromConsole(ZTraceElement.empty))(ZTraceElement.empty)) ++ Clock.live) extends Product with Serializable

    A TestRunner[R, E] encapsulates all the logic necessary to run specs that require an environment R and may fail with an error E.

    A TestRunner[R, E] encapsulates all the logic necessary to run specs that require an environment R and may fail with an error E. Test runners require a test executor, a runtime configuration, and a reporter.

  74. sealed abstract class TestSuccess extends AnyRef
  75. final case class TestTimeoutException(message: String) extends Throwable with Product with Serializable
  76. trait TimeVariants extends AnyRef
  77. trait TimeoutVariants extends AnyRef
  78. sealed trait Trace[+A] extends AnyRef
  79. abstract class ZIOSpec[R <: Has[_]] extends ZIOApp
  80. abstract class ZIOSpecAbstract extends ZIOApp
    Annotations
    @EnableReflectiveInstantiation()
  81. abstract class ZIOSpecDefault extends ZIOSpec[test.environment.TestEnvironment]
  82. type ZSpec[-R, +E] = Spec[R, TestFailure[E], TestSuccess]

    A ZSpec[R, E] is the canonical spec for testing ZIO programs.

    A ZSpec[R, E] is the canonical spec for testing ZIO programs. The spec's test type is a ZIO effect that requires an R and might fail with an E.

  83. type ZTest[-R, +E] = ZIO[R, TestFailure[E], TestSuccess]

    A ZTest[R, E] is an effectfully produced test that requires an R and may fail with an E.

  84. type ZTestEnv = Has[TestClock] with Has[TestConsole] with Has[TestRandom] with Has[TestSystem]

    A ZRTestEnv is an alias for all ZIO provided Restorable TestEnvironment objects

Deprecated Type Members

  1. class DefaultMutableRunnableSpec extends MutableRunnableSpec[Has[Any]]

    Syntax for writing test like

    Syntax for writing test like

    object MySpec extends DefaultMutableRunnableSpec {
      suite("foo") {
        test("name") {
        } @@ ignore
    
        test("name 2")
      }
      suite("another suite") {
        test("name 3")
      }
    }
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use DefaultRunnableSpec

  2. class MutableRunnableSpec[R <: Has[_]] extends RunnableSpec[test.environment.TestEnvironment, Any]

    Syntax for writing test like

    Syntax for writing test like

    object MySpec extends MutableRunnableSpec(layer, aspect) {
      suite("foo") {
        test("name") {
        } @@ ignore
    
        test("name 2")
      }
      suite("another suite") {
        test("name 3")
      }
    }
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use RunnableSpec

Value Members

  1. macro def assert[A](expr: => A)(assertion: Assertion[A]): TestResult

    Checks the assertion holds for the given value.

    Checks the assertion holds for the given value.

    Definition Classes
    CompileVariants
  2. def assertCompletes(implicit trace: ZTraceElement): TestResult

    Asserts that the given test was completed.

  3. def assertCompletesM(implicit trace: ZTraceElement): UIO[TestResult]

    Asserts that the given test was completed.

  4. macro def assertM[R, E, A](effect: ZIO[R, E, A])(assertion: AssertionM[A]): ZIO[R, E, TestResult]

    Checks the assertion holds for the given effectfully-computed value.

    Checks the assertion holds for the given effectfully-computed value.

    Definition Classes
    CompileVariants
  5. macro def assertTrue(expr: Boolean): Assert
    Definition Classes
    CompileVariants
  6. macro def assertTrue(expr: Boolean, exprs: Boolean*): Assert

    Checks the assertion holds for the given value.

    Checks the assertion holds for the given value.

    Definition Classes
    CompileVariants
  7. def check[R <: Has[TestConfig], A, B, C, D, F, G, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], rv6: Gen[R, G])(test: (A, B, C, D, F, G) => TestResult)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of check that accepts six random variables.

  8. def check[R <: Has[TestConfig], A, B, C, D, F, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F])(test: (A, B, C, D, F) => TestResult)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of check that accepts five random variables.

  9. def check[R <: Has[TestConfig], A, B, C, D, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D])(test: (A, B, C, D) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of check that accepts four random variables.

  10. def check[R <: Has[TestConfig], A, B, C, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C])(test: (A, B, C) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of check that accepts three random variables.

  11. def check[R <: Has[TestConfig], A, B, In](rv1: Gen[R, A], rv2: Gen[R, B])(test: (A, B) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of check that accepts two random variables.

  12. def check[R <: Has[TestConfig], A, In](rv: Gen[R, A])(test: (A) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    Checks the test passes for "sufficient" numbers of samples from the given random variable.

  13. def checkAll[R <: Has[TestConfig], A, B, C, D, F, G, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], rv6: Gen[R, G])(test: (A, B, C, D, F, G) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAll that accepts six random variables.

  14. def checkAll[R <: Has[TestConfig], A, B, C, D, F, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F])(test: (A, B, C, D, F) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAll that accepts five random variables.

  15. def checkAll[R <: Has[TestConfig], A, B, C, D, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D])(test: (A, B, C, D) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAll that accepts four random variables.

  16. def checkAll[R <: Has[TestConfig], A, B, C, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C])(test: (A, B, C) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAll that accepts three random variables.

  17. def checkAll[R <: Has[TestConfig], A, B, In](rv1: Gen[R, A], rv2: Gen[R, B])(test: (A, B) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAll that accepts two random variables.

  18. def checkAll[R <: Has[TestConfig], A, In](rv: Gen[R, A])(test: (A) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    Checks the test passes for all values from the given random variable.

    Checks the test passes for all values from the given random variable. This is useful for deterministic Gen that comprehensively explore all possibilities in a given domain.

  19. def checkAllPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F, G, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], rv6: Gen[R, G], parallelism: Int)(test: (A, B, C, D, F, G) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAllMPar that accepts six random variables.

  20. def checkAllPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], parallelism: Int)(test: (A, B, C, D, F) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAllMPar that accepts five random variables.

  21. def checkAllPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], parallelism: Int)(test: (A, B, C, D) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAllMPar that accepts four random variables.

  22. def checkAllPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, In](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], parallelism: Int)(test: (A, B, C) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAllMPar that accepts three random variables.

  23. def checkAllPar[R <: Has[TestConfig], R1 <: R, E, A, B, In](rv1: Gen[R, A], rv2: Gen[R, B], parallelism: Int)(test: (A, B) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    A version of checkAllMPar that accepts two random variables.

  24. def checkAllPar[R <: Has[TestConfig], R1 <: R, E, A, In](rv: Gen[R, A], parallelism: Int)(test: (A) => In)(implicit checkConstructor: CheckConstructor[R, In], trace: ZTraceElement): ZIO[OutEnvironment, OutError, TestResult]

    Checks in parallel the effectual test passes for all values from the given random variable.

    Checks in parallel the effectual test passes for all values from the given random variable. This is useful for deterministic Gen that comprehensively explore all possibilities in a given domain.

  25. def checkN(n: Int): CheckN

    Checks the test passes for the specified number of samples from the given random variable.

  26. val defaultTestRunner: TestRunner[test.environment.TestEnvironment, Any]

    A Runner that provides a default testable environment.

  27. def failed[E](cause: Cause[E])(implicit trace: ZTraceElement): ZIO[Any, TestFailure[E], Nothing]

    Creates a failed test result with the specified runtime cause.

  28. val ignored: UIO[TestSuccess]

    Creates an ignored test result.

  29. def platformSpecific[R, E, A](js: => A, jvm: => A)(f: (A) => ZTest[R, E]): ZTest[R, E]

    Passes platform specific information to the specified function, which will use that information to create a test.

    Passes platform specific information to the specified function, which will use that information to create a test. If the platform is neither ScalaJS nor the JVM, an ignored test result will be returned.

  30. def suite[In](label: String)(specs: In*)(implicit suiteConstructor: SuiteConstructor[In], trace: ZTraceElement): Spec[OutEnvironment, OutError, OutSuccess]

    Builds a suite containing a number of other specs.

  31. def test[In](label: String)(assertion: => In)(implicit testConstructor: TestConstructor[Nothing, In], sourceLocation: SourceLocation, trace: ZTraceElement): Out

    Builds a spec with a single test.

  32. final macro def typeCheck(code: String): UIO[Either[String, Unit]]

    Returns either Right if the specified string type checks as valid Scala code or Left with an error message otherwise.

    Returns either Right if the specified string type checks as valid Scala code or Left with an error message otherwise. Dies with a runtime exception if specified string cannot be parsed or is not a known value at compile time.

    Definition Classes
    CompileVariants
  33. def versionSpecific[R, E, A](dotty: => A, scala2: => A)(f: (A) => ZTest[R, E]): ZTest[R, E]

    Passes version specific information to the specified function, which will use that information to create a test.

    Passes version specific information to the specified function, which will use that information to create a test. If the version is neither Dotty nor Scala 2, an ignored test result will be returned.

  34. object Annotations extends Serializable
  35. object Arrow
  36. object Assert extends Serializable
  37. object Assertion extends AssertionVariants
  38. object AssertionData
  39. object AssertionM
  40. object AssertionMData
  41. object AssertionResult
  42. object AssertionValue
  43. object BoolAlgebra extends Serializable
  44. object BoolAlgebraM extends Serializable
  45. object CheckConstructor extends CheckConstructorLowPriority1
  46. object CheckVariants
  47. object CompileVariants

    Proxy methods to call package private methods from the macro

  48. object DefaultTestReporter
  49. object Eql extends EqlLowPriority
  50. object ErrorMessage
  51. object ExecutedSpec extends Serializable
  52. object FailureCase extends Serializable
  53. object Gen extends GenZIO with FunctionVariants with TimeVariants with Serializable
  54. object GenFailureDetails
  55. object Result
  56. object Sample extends Serializable
  57. object Sized extends Serializable
  58. object SourceLocation extends SourceLocationVariants with Serializable
  59. object Spec extends Serializable
  60. object SuiteConstructor extends SuiteConstructorLowPriority1
  61. object SummaryBuilder
  62. object TestAnnotation extends Serializable
  63. object TestAnnotationMap
  64. object TestAnnotationRenderer
  65. object TestArgs extends Serializable
  66. object TestAspect extends TimeoutVariants
  67. object TestConfig extends Serializable
  68. object TestConstructor extends TestConstructorLowPriority1
  69. object TestExecutor
  70. object TestFailure
  71. object TestLogger extends Serializable
  72. object TestPlatform

    TestPlatform provides information about the platform tests are being run on to enable platform specific test configuration.

  73. object TestReporter
  74. object TestResult
  75. object TestSuccess
  76. object TestVersion

    TestVersion provides information about the Scala version tests are being run on to enable platform specific test configuration.

  77. object Trace
  78. object ZTest

Deprecated Value Members

  1. def checkAllM[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F, G](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], rv6: Gen[R, G])(test: (A, B, C, D, F, G) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllM that accepts six random variables.

    A version of checkAllM that accepts six random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkAll

  2. def checkAllM[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F])(test: (A, B, C, D, F) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllM that accepts five random variables.

    A version of checkAllM that accepts five random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkAll

  3. def checkAllM[R <: Has[TestConfig], R1 <: R, E, A, B, C, D](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D])(test: (A, B, C, D) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllM that accepts four random variables.

    A version of checkAllM that accepts four random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkAll

  4. def checkAllM[R <: Has[TestConfig], R1 <: R, E, A, B, C](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C])(test: (A, B, C) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllM that accepts three random variables.

    A version of checkAllM that accepts three random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkAll

  5. def checkAllM[R <: Has[TestConfig], R1 <: R, E, A, B](rv1: Gen[R, A], rv2: Gen[R, B])(test: (A, B) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllM that accepts two random variables.

    A version of checkAllM that accepts two random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkAll

  6. def checkAllM[R <: Has[TestConfig], R1 <: R, E, A](rv: Gen[R, A])(test: (A) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    Checks the effectual test passes for all values from the given random variable.

    Checks the effectual test passes for all values from the given random variable. This is useful for deterministic Gen that comprehensively explore all possibilities in a given domain.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkAll

  7. def checkAllMPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F, G](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], rv6: Gen[R, G], parallelism: Int)(test: (A, B, C, D, F, G) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllMPar that accepts six random variables.

    A version of checkAllMPar that accepts six random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkPar

  8. def checkAllMPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], parallelism: Int)(test: (A, B, C, D, F) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllMPar that accepts five random variables.

    A version of checkAllMPar that accepts five random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkPar

  9. def checkAllMPar[R <: Has[TestConfig], R1 <: R, E, A, B, C, D](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], parallelism: Int)(test: (A, B, C, D) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllMPar that accepts four random variables.

    A version of checkAllMPar that accepts four random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkPar

  10. def checkAllMPar[R <: Has[TestConfig], R1 <: R, E, A, B, C](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], parallelism: Int)(test: (A, B, C) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllMPar that accepts three random variables.

    A version of checkAllMPar that accepts three random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkPar

  11. def checkAllMPar[R <: Has[TestConfig], R1 <: R, E, A, B](rv1: Gen[R, A], rv2: Gen[R, B], parallelism: Int)(test: (A, B) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkAllMPar that accepts two random variables.

    A version of checkAllMPar that accepts two random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkPar

  12. def checkAllMPar[R <: Has[TestConfig], R1 <: R, E, A](rv: Gen[R, A], parallelism: Int)(test: (A) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    Checks in parallel the effectual test passes for all values from the given random variable.

    Checks in parallel the effectual test passes for all values from the given random variable. This is useful for deterministic Gen that comprehensively explore all possibilities in a given domain.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkPar

  13. def checkM[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F, G](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F], rv6: Gen[R, G])(test: (A, B, C, D, F, G) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkM that accepts six random variables.

    A version of checkM that accepts six random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use check

  14. def checkM[R <: Has[TestConfig], R1 <: R, E, A, B, C, D, F](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D], rv5: Gen[R, F])(test: (A, B, C, D, F) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkM that accepts five random variables.

    A version of checkM that accepts five random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use check

  15. def checkM[R <: Has[TestConfig], R1 <: R, E, A, B, C, D](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C], rv4: Gen[R, D])(test: (A, B, C, D) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkM that accepts four random variables.

    A version of checkM that accepts four random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use check

  16. def checkM[R <: Has[TestConfig], R1 <: R, E, A, B, C](rv1: Gen[R, A], rv2: Gen[R, B], rv3: Gen[R, C])(test: (A, B, C) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkM that accepts three random variables.

    A version of checkM that accepts three random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use check

  17. def checkM[R <: Has[TestConfig], R1 <: R, E, A, B](rv1: Gen[R, A], rv2: Gen[R, B])(test: (A, B) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    A version of checkM that accepts two random variables.

    A version of checkM that accepts two random variables.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use check

  18. def checkM[R <: Has[TestConfig], R1 <: R, E, A](rv: Gen[R, A])(test: (A) => ZIO[R1, E, TestResult])(implicit trace: ZTraceElement): ZIO[R1, E, TestResult]

    Checks the effectual test passes for "sufficient" numbers of samples from the given random variable.

    Checks the effectual test passes for "sufficient" numbers of samples from the given random variable.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use check

  19. def checkNM(n: Int): CheckNM

    Checks the effectual test passes for the specified number of samples from the given random variable.

    Checks the effectual test passes for the specified number of samples from the given random variable.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use checkN

  20. def suiteM[R, E, T](label: String)(specs: ZIO[R, E, Iterable[Spec[R, E, T]]])(implicit trace: ZTraceElement): Spec[R, E, T]

    Builds an effectual suite containing a number of other specs.

    Builds an effectual suite containing a number of other specs.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use suite

  21. def testM[R, E](label: String)(assertion: => ZIO[R, E, TestResult])(implicit loc: SourceLocation, trace: ZTraceElement): ZSpec[R, E]

    Builds a spec with a single effectful test.

    Builds a spec with a single effectful test.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use test

Inherited from CompileVariants

Inherited from AnyRef

Inherited from Any

Ungrouped