Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scalatest GeneratorDrivenPropertyChecks init seed

I'm using Scalatest 3.1.0-SNAP13 and cannot find how to specify the init seed option from this PR. I'm using SBT to run the test so if there is a way to specify this option in build.sbt would be ideal.

like image 676
Minh Thai Avatar asked Dec 04 '25 12:12

Minh Thai


1 Answers

The -S flag seems to be disabled in 3.1.x:

parseLongArgument(seedArgs, "-S") match {
  case Some(seed) => // Randomizer.defaultSeed.getAndSet(Some(seed))
    println("Note: -S for setting the Randomizer seed is not yet supported.")
  case None => // do nothing
}

However it is seems to be enabled in 3.2.x, so try

libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.0-M1" % Test

and

testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-S", "1568769615146")
like image 61
Mario Galic Avatar answered Dec 07 '25 06:12

Mario Galic