Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.
/ scrand Public archive

scrand (SCala-RANDom) generates random instances of various types of Scala classes

License

Notifications You must be signed in to change notification settings

mkroli/scrand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrand

Build Status Coverage Status

scrand (SCala-RANDom) generates random instances of various types of Scala classes.

Usage

sbt

resolvers += "bintray" at "http://dl.bintray.com/mkroli/maven"

libraryDependencies += "com.github.mkroli" %% "scrand" % "0.4.0"

Examples

scala> import com.github.mkroli.scrand._

scala> Random[Int]
res0: Int = 12345

scala> Random[Either[Int, Boolean]]
res1: Either[Int,Boolean] = Right(false)

scala> Random[(Int, Option[(Int, Int)])]
res2: (Int, Option[(Int, Int)]) = (12345,Some((12345,12345)))

scala> case class Inner(i: Int)
scala> case class Outer(b: Boolean, i: Inner)
scala> Random[Outer]
res3: Outer = Outer(true,Inner(12345))

For more examples see src/test/scala/.../RandomSpec.scala.

About

scrand (SCala-RANDom) generates random instances of various types of Scala classes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages