ArbArgsGenerator

Represents an ArgsGenerator which provides generate which generates Ts an infinite number of times in a random or not defined order.

Note, every ArbArgsGenerator also needs to implement CoreArbArgsGenerator. You can then use _core to transform an ArbArgsGenerator into a CoreArbArgsGenerator.

Since

2.0.0

Parameters

T

the type of values generated by this ArbArgsGenerator.

Inheritors

Functions

Link copied to clipboard

Instead of emitting the generated values directly, it takes chunks of size, puts them into a List and returns it.

fun <T, R> ArbArgsGenerator<T>.chunked(size: Int, transform: (List<T>) -> R): ArbArgsGenerator<R>

Instead of emitting the generated values directly, it takes chunks of size, puts them into a List and lets it transform into R.

Link copied to clipboard
fun <T> ArbArgsGenerator<T>.filter(predicate: (T) -> Boolean): ArbArgsGenerator<T>

Filters the Sequence of values this ArbArgsGenerator will generate which match the given predicate - should not filter out all values otherwise it will break the ArgsGenerator contract.

Link copied to clipboard

Filters the Sequence of values this ArbArgsGenerator will generate which do not match the given predicate - should not filter out all values otherwise it will break the ArgsGenerator contract.

Link copied to clipboard
fun <T, R> ArbArgsGenerator<T>.flatMapIndexedInternal(transform: (index: Int, T, seedOffset: Int) -> Sequence<R>): ArbArgsGenerator<R>

Maps the values this ArbArgsGenerator generates together with an index and a seed offset to a finite Sequence<R> with the help of the given transform function and then flattens them so that the resulting ArbArgsGenerator returns values of type R.

Link copied to clipboard

Creates for each generated value of type A1 by this ArbArgsGenerator another ArbArgsGenerator with the help of the given otherFactory, generates the given amount of values, and zips them together with the value of this ArbArgsGenerator.

fun <A1, A2, R> ArbArgsGenerator<A1>.flatZipDependent(amount: Int, otherFactory: ArbExtensionPoint.(A1) -> ArbArgsGenerator<A2>, transform: (A1, A2) -> R): ArbArgsGenerator<R>

Creates for each generated value of type A1 by this ArbArgsGenerator another ArbArgsGenerator with the help of the given otherFactory, generates the given amount of values, and transforms them together with the value of this ArbArgsGenerator to type R.

Link copied to clipboard
abstract fun generate(seedOffset: Int = 0): Sequence<T>

Generates an infinite stream of random values of type T.

Link copied to clipboard

Returns a finite Sequence of values of size take.

Link copied to clipboard

Returns a finite Sequence of values based on the ArgsRange that the configured ArgsRangeDecider will chose. decide on.

Link copied to clipboard
open fun generateOne(seedOffset: Int = 0): T

Returns one random value of type T.

Link copied to clipboard
fun <T, R> ArbArgsGenerator<T>.map(transform: (T) -> R): ArbArgsGenerator<R>

Maps the values this ArbArgsGenerator generates to type R with the help of the given transform function.

Link copied to clipboard
fun <T, R> ArbArgsGenerator<T>.mapIndexedInternal(transform: (index: Int, T, seedOffset: Int) -> R): ArbArgsGenerator<R>

Maps the values this ArbArgsGenerator generates together with an index and a seed offset to type R with the help of the given transform function.

Link copied to clipboard
fun <T, R> ArbArgsGenerator<T>.transform(transform: (Sequence<T>, seedOffset: Int) -> Sequence<R>): ArbArgsGenerator<R>

Transforms the Sequence will generate into a Sequence of type R and thus creating a ArbArgsGenerator of type R.

Link copied to clipboard
@JvmName(name = "zipToTuple2")
fun <A1, A2> ArbArgsGenerator<A1>.zip(other: ArbArgsGenerator<A2>): ArbArgsGenerator<Tuple2<A1, A2>>
@JvmName(name = "zipToTuple5")
fun <A1, A2, A3, A4, A5> ArbArgsGenerator<Tuple4<A1, A2, A3, A4>>.zip(other: ArbArgsGenerator<A5>): ArbArgsGenerator<Tuple5<A1, A2, A3, A4, A5>>
@JvmName(name = "zipToTuple6")
fun <A1, A2, A3, A4, A5, A6> ArbArgsGenerator<Tuple5<A1, A2, A3, A4, A5>>.zip(other: ArbArgsGenerator<A6>): ArbArgsGenerator<Tuple6<A1, A2, A3, A4, A5, A6>>
@JvmName(name = "zipToTuple7")
fun <A1, A2, A3, A4, A5, A6, A7> ArbArgsGenerator<Tuple6<A1, A2, A3, A4, A5, A6>>.zip(other: ArbArgsGenerator<A7>): ArbArgsGenerator<Tuple7<A1, A2, A3, A4, A5, A6, A7>>
@JvmName(name = "zipToTuple8")
fun <A1, A2, A3, A4, A5, A6, A7, A8> ArbArgsGenerator<Tuple7<A1, A2, A3, A4, A5, A6, A7>>.zip(other: ArbArgsGenerator<A8>): ArbArgsGenerator<Tuple8<A1, A2, A3, A4, A5, A6, A7, A8>>
@JvmName(name = "zipToTuple9")
fun <A1, A2, A3, A4, A5, A6, A7, A8, A9> ArbArgsGenerator<Tuple8<A1, A2, A3, A4, A5, A6, A7, A8>>.zip(other: ArbArgsGenerator<A9>): ArbArgsGenerator<Tuple9<A1, A2, A3, A4, A5, A6, A7, A8, A9>>
@JvmName(name = "zipToTuple3")
fun <A1, A2, A3> ArbArgsGenerator<Tuple2<A1, A2>>.zip(other: ArbArgsGenerator<A3>): ArbArgsGenerator<Tuple3<A1, A2, A3>>
@JvmName(name = "zipToTuple4")
fun <A1, A2, A3, A4> ArbArgsGenerator<Tuple3<A1, A2, A3>>.zip(other: ArbArgsGenerator<A4>): ArbArgsGenerator<Tuple4<A1, A2, A3, A4>>

Zips this ArbArgsGenerator with the given other ArbArgsGenerator.

fun <A1, A2, R> ArbArgsGenerator<A1>.zip(other: ArbArgsGenerator<A2>, transform: (A1, A2) -> R): ArbArgsGenerator<R>

Zips this ArbArgsGenerator with the given other ArbArgsGenerator, transforming the pairwise generated values of type A1 and A2 to type R.

Link copied to clipboard
@JvmName(name = "zipDependentToTuple2")
fun <A1, A2> ArbArgsGenerator<A1>.zipDependent(otherFactory: ArbExtensionPoint.(A1) -> ArbArgsGenerator<A2>): ArbArgsGenerator<Tuple2<A1, A2>>

Creates for each generated value of type A1 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple5")
fun <A1, A2, A3, A4, A5> ArbArgsGenerator<Tuple4<A1, A2, A3, A4>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple4<A1, A2, A3, A4>) -> ArbArgsGenerator<A5>): ArbArgsGenerator<Tuple5<A1, A2, A3, A4, A5>>

Creates for each generated value of type Tuple4 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple6")
fun <A1, A2, A3, A4, A5, A6> ArbArgsGenerator<Tuple5<A1, A2, A3, A4, A5>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple5<A1, A2, A3, A4, A5>) -> ArbArgsGenerator<A6>): ArbArgsGenerator<Tuple6<A1, A2, A3, A4, A5, A6>>

Creates for each generated value of type Tuple5 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple7")
fun <A1, A2, A3, A4, A5, A6, A7> ArbArgsGenerator<Tuple6<A1, A2, A3, A4, A5, A6>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple6<A1, A2, A3, A4, A5, A6>) -> ArbArgsGenerator<A7>): ArbArgsGenerator<Tuple7<A1, A2, A3, A4, A5, A6, A7>>

Creates for each generated value of type Tuple6 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple8")
fun <A1, A2, A3, A4, A5, A6, A7, A8> ArbArgsGenerator<Tuple7<A1, A2, A3, A4, A5, A6, A7>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple7<A1, A2, A3, A4, A5, A6, A7>) -> ArbArgsGenerator<A8>): ArbArgsGenerator<Tuple8<A1, A2, A3, A4, A5, A6, A7, A8>>

Creates for each generated value of type Tuple7 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple9")
fun <A1, A2, A3, A4, A5, A6, A7, A8, A9> ArbArgsGenerator<Tuple8<A1, A2, A3, A4, A5, A6, A7, A8>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple8<A1, A2, A3, A4, A5, A6, A7, A8>) -> ArbArgsGenerator<A9>): ArbArgsGenerator<Tuple9<A1, A2, A3, A4, A5, A6, A7, A8, A9>>

Creates for each generated value of type Tuple8 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple3")
fun <A1, A2, A3> ArbArgsGenerator<Tuple2<A1, A2>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple2<A1, A2>) -> ArbArgsGenerator<A3>): ArbArgsGenerator<Tuple3<A1, A2, A3>>

Creates for each generated value of type Tuple2 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

@JvmName(name = "zipDependentToTuple4")
fun <A1, A2, A3, A4> ArbArgsGenerator<Tuple3<A1, A2, A3>>.zipDependent(otherFactory: ArbExtensionPoint.(Tuple3<A1, A2, A3>) -> ArbArgsGenerator<A4>): ArbArgsGenerator<Tuple4<A1, A2, A3, A4>>

Creates for each generated value of type Tuple3 by this ArbArgsGenerator an ArbArgsGenerator with the help of the given otherFactory and then zips the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator.

fun <A1, A2, R> ArbArgsGenerator<A1>.zipDependent(otherFactory: ArbExtensionPoint.(A1) -> ArbArgsGenerator<A2>, transform: (A1, A2) -> R): ArbArgsGenerator<R>

Creates for each generated value of type A1 by this ArbArgsGenerator another ArbArgsGenerator with the help of the given otherFactory and then transforms the value of this ArbArgsGenerator with one value of the other ArbArgsGenerator to type R.