File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/test/scala/fpinscalalib Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 7
7
package fpinscalalib
8
8
9
9
import org .scalacheck .ScalacheckShapeless ._
10
+ import org .scalacheck .{Arbitrary , Gen }
10
11
import org .scalaexercises .Test
11
12
import org .scalatest .refspec .RefSpec
12
13
import org .scalatestplus .scalacheck .Checkers
13
- import shapeless .HNil
14
+ import shapeless ._
14
15
15
16
class GettingStartedWithFPSpec extends RefSpec with Checkers {
16
- // def `fibonacci asserts`() =
17
- // check(Test.testSuccess(GettingStartedWithFPSection.fibAssert _, 0 :: 1 :: HNil))
17
+
18
+ def `fibonacci asserts` () = {
19
+ implicit val arb = Arbitrary {
20
+ for {
21
+ res0 <- Gen .choose(2 , 10 )
22
+ res1 <- Gen .choose(2 , 10 )
23
+ } yield res0 :: res1 :: HNil
24
+ }
25
+
26
+ check(Test .testSuccess(GettingStartedWithFPSection .fibAssert _, 0 :: 1 :: HNil ))
27
+ }
18
28
19
29
def `isSorted asserts` () =
20
30
check(
You can’t perform that action at this time.
0 commit comments