Test

zio.test.TestRandom.Test
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)

Attributes

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

Members list

Type members

Inherited classlikes

trait UnsafeAPI extends Serializable

Attributes

Inherited from:
Random
Source
Random.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

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

Clears the buffer of booleans.

Clears the buffer of booleans.

Attributes

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

Clears the buffer of bytes.

Clears the buffer of bytes.

Attributes

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

Clears the buffer of characters.

Clears the buffer of characters.

Attributes

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

Clears the buffer of doubles.

Clears the buffer of doubles.

Attributes

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

Clears the buffer of floats.

Clears the buffer of floats.

Attributes

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

Clears the buffer of integers.

Clears the buffer of integers.

Attributes

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

Clears the buffer of longs.

Clears the buffer of longs.

Attributes

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

Clears the buffer of strings.

Clears the buffer of strings.

Attributes

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

Clears the buffer of UUIDs.

Clears the buffer of UUIDs.

Attributes

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

Feeds the buffer with specified sequence of booleans. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of booleans. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of chunks of bytes. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of chunks of bytes. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of characters. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of characters. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of doubles. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of doubles. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of floats. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of floats. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of integers. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of integers. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of longs. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of longs. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of strings. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of strings. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Feeds the buffer with specified sequence of UUIDs. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Feeds the buffer with specified sequence of UUIDs. The first value in the sequence will be the first to be taken. These values will be taken before any values that were previously in the buffer.

Attributes

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

Gets the seed of this TestRandom.

Gets the seed of this TestRandom.

Attributes

Source
TestRandom.scala
def nextBoolean(implicit trace: Trace): UIO[Boolean]

Takes a boolean from the buffer if one exists or else generates a pseudo-random boolean.

Takes a boolean from the buffer if one exists or else generates a pseudo-random boolean.

Attributes

Source
TestRandom.scala
def nextBytes(length: => Int)(implicit trace: Trace): UIO[Chunk[Byte]]

Takes a chunk of bytes from the buffer if one exists or else generates a pseudo-random chunk of bytes of the specified length.

Takes a chunk of bytes from the buffer if one exists or else generates a pseudo-random chunk of bytes of the specified length.

Attributes

Source
TestRandom.scala
def nextDouble(implicit trace: Trace): UIO[Double]

Takes a double from the buffer if one exists or else generates a pseudo-random, uniformly distributed double between 0.0 and 1.0.

Takes a double from the buffer if one exists or else generates a pseudo-random, uniformly distributed double between 0.0 and 1.0.

Attributes

Source
TestRandom.scala
def nextDoubleBetween(minInclusive: => Double, maxExclusive: => Double)(implicit trace: Trace): UIO[Double]

Takes a double from the buffer if one exists or else generates a pseudo-random double in the specified range.

Takes a double from the buffer if one exists or else generates a pseudo-random double in the specified range.

Attributes

Source
TestRandom.scala
def nextFloat(implicit trace: Trace): UIO[Float]

Takes a float from the buffer if one exists or else generates a pseudo-random, uniformly distributed float between 0.0 and 1.0.

Takes a float from the buffer if one exists or else generates a pseudo-random, uniformly distributed float between 0.0 and 1.0.

Attributes

Source
TestRandom.scala
def nextFloatBetween(minInclusive: => Float, maxExclusive: => Float)(implicit trace: Trace): UIO[Float]

Takes a float from the buffer if one exists or else generates a pseudo-random float in the specified range.

Takes a float from the buffer if one exists or else generates a pseudo-random float in the specified range.

Attributes

Source
TestRandom.scala
def nextGaussian(implicit trace: Trace): UIO[Double]

Takes a double from the buffer if one exists or else generates a pseudo-random double from a normal distribution with mean 0.0 and standard deviation 1.0.

Takes a double from the buffer if one exists or else generates a pseudo-random double from a normal distribution with mean 0.0 and standard deviation 1.0.

Attributes

Source
TestRandom.scala
def nextInt(implicit trace: Trace): UIO[Int]

Takes an integer from the buffer if one exists or else generates a pseudo-random integer.

Takes an integer from the buffer if one exists or else generates a pseudo-random integer.

Attributes

Source
TestRandom.scala
def nextIntBetween(minInclusive: => Int, maxExclusive: => Int)(implicit trace: Trace): UIO[Int]

Takes an integer from the buffer if one exists or else generates a pseudo-random integer in the specified range.

Takes an integer from the buffer if one exists or else generates a pseudo-random integer in the specified range.

Attributes

Source
TestRandom.scala
def nextIntBounded(n: => Int)(implicit trace: Trace): UIO[Int]

Takes an integer from the buffer if one exists or else generates a pseudo-random integer between 0 (inclusive) and the specified value (exclusive).

Takes an integer from the buffer if one exists or else generates a pseudo-random integer between 0 (inclusive) and the specified value (exclusive).

Attributes

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

Takes a long from the buffer if one exists or else generates a pseudo-random long.

Takes a long from the buffer if one exists or else generates a pseudo-random long.

Attributes

Source
TestRandom.scala
def nextLongBetween(minInclusive: => Long, maxExclusive: => Long)(implicit trace: Trace): UIO[Long]

Takes a long from the buffer if one exists or else generates a pseudo-random long in the specified range.

Takes a long from the buffer if one exists or else generates a pseudo-random long in the specified range.

Attributes

Source
TestRandom.scala
def nextLongBounded(n: => Long)(implicit trace: Trace): UIO[Long]

Takes a long from the buffer if one exists or else generates a pseudo-random long between 0 (inclusive) and the specified value (exclusive).

Takes a long from the buffer if one exists or else generates a pseudo-random long between 0 (inclusive) and the specified value (exclusive).

Attributes

Source
TestRandom.scala
def nextPrintableChar(implicit trace: Trace): UIO[Char]

Takes a character from the buffer if one exists or else generates a pseudo-random character from the ASCII range 33-126.

Takes a character from the buffer if one exists or else generates a pseudo-random character from the ASCII range 33-126.

Attributes

Source
TestRandom.scala
def nextString(length: => Int)(implicit trace: Trace): UIO[String]

Takes a string from the buffer if one exists or else generates a pseudo-random string of the specified length.

Takes a string from the buffer if one exists or else generates a pseudo-random string of the specified length.

Attributes

Source
TestRandom.scala
def nextUUID(implicit trace: Trace): UIO[UUID]

Takes a UUID from the buffer if one exists or else generates a pseudo-random UUID.

Takes a UUID from the buffer if one exists or else generates a pseudo-random UUID.

Attributes

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

Saves the TestRandom's current state in an effect which, when run, will restore the TestRandom state to the saved state.

Saves the TestRandom's current state in an effect which, when run, will restore the TestRandom state to the saved state.

Attributes

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

Sets the seed of this TestRandom to the specified value.

Sets the seed of this TestRandom to the specified value.

Attributes

Source
TestRandom.scala
def shuffle[A, Collection <: (Iterable)](list: => Collection[A])(implicit bf: BuildFrom[Collection[A], A, Collection[A]], trace: Trace): UIO[Collection[A]]

Randomly shuffles the specified list.

Randomly shuffles the specified list.

Attributes

Source
TestRandom.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

override val unsafe: UnsafeAPI

Attributes

Source
TestRandom.scala