Test

final case class Test(randomState: Ref[Data], bufferState: Ref[Buffer]) extends Service with Service

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

trait Product
trait Equals
trait Service
trait Service
class Object
trait Matchable
class Any

Value members

Concrete methods

def feedBooleans(booleans: Boolean*): 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.

def feedBytes(bytes: Chunk[Byte]*): 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.

def feedChars(chars: Char*): 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.

def feedDoubles(doubles: Double*): 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.

def feedFloats(floats: Float*): 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.

def feedInts(ints: Int*): 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.

def feedLongs(longs: Long*): 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.

def feedStrings(strings: String*): 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.

def feedUUIDs(UUIDs: UUID*): 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.

def nextBytes(length: Int): 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.

def nextDoubleBetween(minInclusive: Double, maxExclusive: Double): 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.

def nextFloatBetween(minInclusive: Float, maxExclusive: Float): 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.

def nextIntBetween(minInclusive: Int, maxExclusive: Int): 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.

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

def nextLongBetween(minInclusive: Long, maxExclusive: Long): 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.

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

def nextString(length: Int): 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.

def setSeed(seed: Long): UIO[Unit]

Sets the seed of this TestRandom to the specified value.

Sets the seed of this TestRandom to the specified value.

def shuffle[A, Collection <: (Iterable)](list: Collection[A])(implicit bf: BuildFrom[Collection[A], A, Collection[A]]): UIO[Collection[A]]

Randomly shuffles the specified list.

Randomly shuffles the specified list.

Inherited methods

Inherited from:
Product

Concrete fields

Clears the buffer of booleans.

Clears the buffer of booleans.

Clears the buffer of bytes.

Clears the buffer of bytes.

Clears the buffer of characters.

Clears the buffer of characters.

Clears the buffer of doubles.

Clears the buffer of doubles.

Clears the buffer of floats.

Clears the buffer of floats.

Clears the buffer of integers.

Clears the buffer of integers.

Clears the buffer of longs.

Clears the buffer of longs.

Clears the buffer of strings.

Clears the buffer of strings.

Clears the buffer of UUIDs.

Clears the buffer of UUIDs.

Gets the seed of this TestRandom.

Gets the seed of this TestRandom.

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.

lazy val nextDouble: 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.

lazy val nextFloat: 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.

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.

lazy val nextInt: 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.

lazy val nextLong: 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.

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.

lazy override val nextUUID: 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.

val save: 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.