Skip to content
Snippets Groups Projects
RandomSpec.scala 578 B
Newer Older
package readerwriter

import org.scalatest._
import testutil.PendingIfUnimplemented

class RandomSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
  val initial = Simple(192837465L)
  val (r1, i1) = initial.nextInt
  val (r2, i2) = r1.nextInt
  val (r3, i3) = r2.nextInt

  "threeInts" should "have the same result as passing state manually" in {
    Randoms.threeInts.run(initial)._2 shouldBe ((i1, i2, i3))
  }
  it should "result in the same rng state as passing state manually" in {
    Randoms.threeInts.run(initial)._1 shouldBe r3
  }
}