This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of nesting forAll calls, we could have defined a custom generator in the following way: | |
import org.scalacheck.Arbitrary.arbitrary | |
import org.scalacheck.Gen.choose | |
val genStringWithN = for { | |
s <- arbitrary[String] | |
n <- choose(0, s.length) | |
} yield (s,n) |
NewerOlder