|
1 | 1 | /* |
2 | | - * scala-exercises - exercises-scalacheck |
3 | | - * Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com> |
| 2 | + * scala-exercises - exercises-scalacheck |
| 3 | + * Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com> |
| 4 | + * |
4 | 5 | */ |
5 | 6 |
|
6 | 7 | package scalachecklib |
7 | 8 |
|
8 | 9 | import org.scalatest.Matchers |
9 | | -import org.scalatest.prop.Checkers |
| 10 | +import org.scalatestplus.scalacheck.Checkers |
10 | 11 |
|
11 | 12 | /** Generators are responsible for generating test data in ScalaCheck, and are represented by the `org.scalacheck.Gen` |
12 | | - * class. In the `Gen` object, there are several methods for creating new and modifying existing generators. |
| 13 | + * class. ou need to know how to use this class if you want ScalaCheck to generate data of types that are not supported |
| 14 | + * by default, or if you want to use the `forAll` method mentioned above, to state properties about a specific subset of |
| 15 | + * a type. In the `Gen` object, there are several methods for creating new and modifying existing generators. |
13 | 16 | * We will show how to use some of them in this section. For a more complete reference of what is available, |
14 | | - * please see the [[https://www.scalacheck.org/files/scalacheck_2.11-1.13.4-api/index.html API scaladoc]]. |
| 17 | + * please see the API scaladoc. |
15 | 18 | * |
16 | 19 | * |
17 | 20 | * A generator can be seen simply as a function that takes some generation parameters, and (maybe) returns a |
@@ -214,13 +217,15 @@ object GeneratorsSection |
214 | 217 | * {{{ |
215 | 218 | * val genIntList = Gen.containerOf[List,Int](Gen.oneOf(1, 3, 5)) |
216 | 219 | * |
217 | | - * val genStringStream = Gen.containerOf[Stream,String](Gen.alphaStr) |
| 220 | + * val genStringStream = Gen.containerOf[LazyList,String](Gen.alphaStr) |
218 | 221 | * |
219 | 222 | * val genBoolArray = Gen.containerOf[Array,Boolean](true) |
220 | 223 | * }}} |
221 | 224 | * |
222 | | - * By default, ScalaCheck supports generation of `List`, `Stream`, `Set`, `Array`, and `ArrayList` |
223 | | - * (from `java.util`). You can add support for additional containers by adding implicit `Buildable` instances. |
| 225 | + * By default, ScalaCheck supports generation of `List`, `Stream` (Scala 2.10 - |
| 226 | + * 2.12, deprecated in 2.13), `LazyList` (Scala 2.13), `Set`, `Array`, and |
| 227 | + * `ArrayList` (from `java.util`). You can add support for additional containers |
| 228 | + * by adding implicit `Buildable` instances. See `Buildable.scala` for examples. |
224 | 229 | * |
225 | 230 | * There is also `Gen.nonEmptyContainerOf` for generating non-empty containers, and `Gen.containerOfN` for |
226 | 231 | * generating containers of a given size. |
|
0 commit comments