Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package fpinscala.datastructures
  2.  
  3. import org.scalatest.prop.TableDrivenPropertyChecks._
  4. import org.scalatest.{FeatureSpec, Matchers}
  5.  
  6.  
  7. /**
  8. * Created by michal on 2/15/15.
  9. */
  10.  
  11. class ListTest extends FeatureSpec with Matchers {
  12. feature ("The tail"){
  13. import fpinscala.datastructures.List._
  14. scenario ("should return tail of the list"){
  15.  
  16. val dataset =
  17. Table(
  18. ("in", "out" ),
  19. (Nil, Nil ),
  20. (List(1), Nil ),
  21. (List(1,2),List(2) )
  22. )
  23.  
  24. forAll (dataset) { (in: List[Int], out: List[Int]) =>
  25. tail(in) shouldEqual out
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement