Checking RNG Differences in Unit Tests

Usage

checkRNG(x, y = getRNG(), ...)

Arguments

x,y
objects from which RNG settings are extracted.
...
extra arguments passed to rng.equal.

Description

checkRNG checks if two objects have the same RNG settings and should be used in unit tests, e.g., with the RUnit package.

Examples

# check for differences in RNG
set.seed(123)
checkRNG(123)
Using RUnit framework provider: RUnit
[1] TRUE
try( checkRNG(123, 123) )
[1] TRUE
try( checkRNG(123, 1:3) )