Last active
April 23, 2016 22:45
-
-
Save aeyakovenko/9e58e99c8e1d43cd31fe0d6bd94fc0ac to your computer and use it in GitHub Desktop.
This file contains 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
val slices: Gen[(Int,Int,List[Int])] = for { | |
a <- Gen.listOf(Gen.choose(-100,100)) | |
j <- Gen.choose(0, a.length) | |
k <- Gen.choose(j, a.length) | |
} yeild(j,k,a) | |
property("slice") = forAll(slices) { g => | |
val (j,k,a) = g | |
val (p,s,e) = Scala99.slice(j, k, a) | |
(p ++ s ++ e == a) && (s.length == (k - j)) | |
} | |
[info] Compiling 1 Scala source to /home/anatolyy/scala-99/target/scala-2.11/test-classes... | |
[error] /home/anatolyy/scala-99/src/test/scala/scala-99.scala:98: value foreach is not a member of org.scalacheck.Gen[List[Int]] | |
[error] a <- Gen.listOf(Gen.choose(-100,100)) | |
[error] ^ | |
[error] one error found | |
[error] (test:compileIncremental) Compilation failed | |
[error] Total time: 2 s, completed Apr 19, 2016 8:11:50 AM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment