TestRandom

zio.test.TestRandom
See theTestRandom companion trait
object TestRandom extends Serializable

Attributes

Companion
trait
Source
TestRandom.scala
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
TestRandom.type

Members list

Type members

Classlikes

final case class Buffer(booleans: List[Boolean] = ..., bytes: List[Byte] = ..., chars: List[Char] = ..., doubles: List[Double] = ..., floats: List[Float] = ..., integers: List[Int] = ..., longs: List[Long] = ..., strings: List[String] = ..., uuids: List[UUID] = ...)

The buffer of the TestRandom.

The buffer of the TestRandom.

Attributes

Source
TestRandom.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Data(seed1: Int, seed2: Int, nextNextGaussians: Queue[Double] = ...)

The seed of the TestRandom.

The seed of the TestRandom.

Attributes

Source
TestRandom.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Test(randomState: Atomic[Data], bufferState: Atomic[Buffer]) extends TestRandom

Adapted from @gzmo work in Scala.js (https://github.com/scala-js/scala-js/pull/780)

Adapted from @gzmo work in Scala.js (https://github.com/scala-js/scala-js/pull/780)

Attributes

Source
TestRandom.scala
Supertypes
trait Product
trait Equals
trait TestRandom
trait Restorable
trait Random
trait Serializable
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def clearBooleans(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of booleans.

Accesses a TestRandom instance in the environment and clears the buffer of booleans.

Attributes

Source
TestRandom.scala
def clearBytes(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of bytes.

Accesses a TestRandom instance in the environment and clears the buffer of bytes.

Attributes

Source
TestRandom.scala
def clearChars(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of characters.

Accesses a TestRandom instance in the environment and clears the buffer of characters.

Attributes

Source
TestRandom.scala
def clearDoubles(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of doubles.

Accesses a TestRandom instance in the environment and clears the buffer of doubles.

Attributes

Source
TestRandom.scala
def clearFloats(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of floats.

Accesses a TestRandom instance in the environment and clears the buffer of floats.

Attributes

Source
TestRandom.scala
def clearInts(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of integers.

Accesses a TestRandom instance in the environment and clears the buffer of integers.

Attributes

Source
TestRandom.scala
def clearLongs(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of longs.

Accesses a TestRandom instance in the environment and clears the buffer of longs.

Attributes

Source
TestRandom.scala
def clearStrings(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of strings.

Accesses a TestRandom instance in the environment and clears the buffer of strings.

Attributes

Source
TestRandom.scala
def clearUUIDs(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and clears the buffer of UUIDs.

Accesses a TestRandom instance in the environment and clears the buffer of UUIDs.

Attributes

Source
TestRandom.scala
def feedBooleans(booleans: Boolean*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of booleans.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of booleans.

Attributes

Source
TestRandom.scala
def feedBytes(bytes: Chunk[Byte]*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of chunks of bytes.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of chunks of bytes.

Attributes

Source
TestRandom.scala
def feedChars(chars: Char*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of characters.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of characters.

Attributes

Source
TestRandom.scala
def feedDoubles(doubles: Double*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of doubles.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of doubles.

Attributes

Source
TestRandom.scala
def feedFloats(floats: Float*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of floats.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of floats.

Attributes

Source
TestRandom.scala
def feedInts(ints: Int*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of integers.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of integers.

Attributes

Source
TestRandom.scala
def feedLongs(longs: Long*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of longs.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of longs.

Attributes

Source
TestRandom.scala
def feedStrings(strings: String*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of strings.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of strings.

Attributes

Source
TestRandom.scala
def feedUUIDs(uuids: UUID*)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of UUIDs.

Accesses a TestRandom instance in the environment and feeds the buffer with the specified sequence of UUIDs.

Attributes

Source
TestRandom.scala
def getSeed(implicit trace: Trace): UIO[Long]

Accesses a TestRandom instance in the environment and gets the seed.

Accesses a TestRandom instance in the environment and gets the seed.

Attributes

Source
TestRandom.scala
def make(data: Data): Layer[Nothing, TestRandom]

Constructs a new TestRandom with the specified initial state. This can be useful for providing the required environment to an effect that requires a Random, such as with ZIO#provide.

Constructs a new TestRandom with the specified initial state. This can be useful for providing the required environment to an effect that requires a Random, such as with ZIO#provide.

Attributes

Source
TestRandom.scala
def makeTest(data: Data)(implicit trace: Trace): UIO[Test]

Constructs a new Test object that implements the TestRandom interface. This can be useful for mixing in with implementations of other interfaces.

Constructs a new Test object that implements the TestRandom interface. This can be useful for mixing in with implementations of other interfaces.

Attributes

Source
TestRandom.scala
def save(implicit trace: Trace): UIO[UIO[Unit]]

Accesses a TestRandom instance in the environment and saves the random state in an effect which, when run, will restore the TestRandom to the saved state.

Accesses a TestRandom instance in the environment and saves the random state in an effect which, when run, will restore the TestRandom to the saved state.

Attributes

Source
TestRandom.scala
def setSeed(seed: => Long)(implicit trace: Trace): UIO[Unit]

Accesses a TestRandom instance in the environment and sets the seed to the specified value.

Accesses a TestRandom instance in the environment and sets the seed to the specified value.

Attributes

Source
TestRandom.scala

Concrete fields

An arbitrary initial seed for the TestRandom.

An arbitrary initial seed for the TestRandom.

Attributes

Source
TestRandom.scala
val any: ZLayer[TestRandom, Nothing, TestRandom]

Attributes

Source
TestRandom.scala
val deterministic: Layer[Nothing, TestRandom]

Attributes

Source
TestRandom.scala
val random: ZLayer[Clock, Nothing, TestRandom]

Attributes

Source
TestRandom.scala

Implicits

Implicits

implicit val tag: Tag[TestRandom]

Attributes

Source
TestRandom.scala