Skip to content

Commit 59b65f2

Browse files
committed
Solved problem with test
1 parent 1f47d24 commit 59b65f2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/test/scala/fpinscalalib/GettingStartedWithFPSpec.scala

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@
77
package fpinscalalib
88

99
import org.scalacheck.ScalacheckShapeless._
10+
import org.scalacheck.{Arbitrary, Gen}
1011
import org.scalaexercises.Test
1112
import org.scalatest.refspec.RefSpec
1213
import org.scalatestplus.scalacheck.Checkers
13-
import shapeless.HNil
14+
import shapeless._
1415

1516
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+
}
1828

1929
def `isSorted asserts`() =
2030
check(

0 commit comments

Comments
 (0)