Class/Object

zio.test

Gen

Related Docs: object Gen | package test

Permalink

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. Generators may be random or deterministic.

Self Type
Gen[R, A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gen
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Gen(sample: ZStream[R, Nothing, Option[Sample[R, A]]])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[R1 <: R, A1 >: A](that: Gen[R1, A1])(implicit trace: Trace): Gen[R1, A1]

    Permalink

    A symbolic alias for concat.

  4. def <*>[R1 <: R, B](that: Gen[R1, B])(implicit zippable: Zippable[A, B], trace: Trace): Gen[R1, Out]

    Permalink

    A symbolic alias for zip.

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def collect[B](pf: PartialFunction[A, B])(implicit trace: Trace): Gen[R, B]

    Permalink

    Maps the values produced by this generator with the specified partial function, discarding any values the partial function is not defined at.

  9. def concat[R1 <: R, A1 >: A](that: Gen[R1, A1])(implicit trace: Trace): Gen[R1, A1]

    Permalink

    Concatenates the specified deterministic generator with this determinstic generator, resulting in a deterministic generator that generates the values from this generator and then the values from the specified generator.

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def filter(f: (A) ⇒ Boolean)(implicit trace: Trace): Gen[R, A]

    Permalink

    Filters the values produced by this generator, discarding any values that do not meet the specified predicate.

    Filters the values produced by this generator, discarding any values that do not meet the specified predicate. Using filter can reduce test performance, especially if many values must be discarded. It is recommended to use combinators such as map and flatMap to create generators of the desired values instead.

    val evens: Gen[Any, Int] = Gen.int.map(_ * 2)
  12. def filterNot(f: (A) ⇒ Boolean)(implicit trace: Trace): Gen[R, A]

    Permalink

    Filters the values produced by this generator, discarding any values that meet the specified predicate.

  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def flatMap[R1 <: R, B](f: (A) ⇒ Gen[R1, B])(implicit trace: Trace): Gen[R1, B]

    Permalink
  15. def flatten[R1 <: R, B](implicit ev: <:<[A, Gen[R1, B]], trace: Trace): Gen[R1, B]

    Permalink
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def map[B](f: (A) ⇒ B)(implicit trace: Trace): Gen[R, B]

    Permalink
  19. def mapZIO[R1 <: R, B](f: (A) ⇒ ZIO[R1, Nothing, B])(implicit trace: Trace): Gen[R1, B]

    Permalink

    Maps an effectual function over a generator.

  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def noShrink(implicit trace: Trace): Gen[R, A]

    Permalink

    Discards the shrinker for this generator.

  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. def reshrink[R1 <: R, B](f: (A) ⇒ Sample[R1, B])(implicit trace: Trace): Gen[R1, B]

    Permalink

    Discards the shrinker for this generator and applies a new shrinker by mapping each value to a sample using the specified function.

    Discards the shrinker for this generator and applies a new shrinker by mapping each value to a sample using the specified function. This is useful when the process to shrink a value is simpler than the process used to generate it.

  25. def resize(size: Int)(implicit trace: Trace): Gen[R, A]

    Permalink

    Sets the size parameter for this generator to the specified value.

  26. def runCollect(implicit trace: Trace): ZIO[R, Nothing, List[A]]

    Permalink

    Runs the generator and collects all of its values in a list.

  27. def runCollectN(n: Int)(implicit trace: Trace): ZIO[R, Nothing, List[A]]

    Permalink

    Repeatedly runs the generator and collects the specified number of values in a list.

  28. def runHead(implicit trace: Trace): ZIO[R, Nothing, Option[A]]

    Permalink

    Runs the generator returning the first value of the generator.

  29. val sample: ZStream[R, Nothing, Option[Sample[R, A]]]

    Permalink
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def withFilter(f: (A) ⇒ Boolean)(implicit trace: Trace): Gen[R, A]

    Permalink
  35. def zip[R1 <: R, B](that: Gen[R1, B])(implicit zippable: Zippable[A, B], trace: Trace): Gen[R1, Out]

    Permalink

    Composes this generator with the specified generator to create a cartesian product of elements.

  36. def zipWith[R1 <: R, B, C](that: Gen[R1, B])(f: (A, B) ⇒ C)(implicit trace: Trace): Gen[R1, C]

    Permalink

    Composes this generator with the specified generator to create a cartesian product of elements with the specified function.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped