Sha256: 3e490d177d82e80dd88753ee511bb97cf35abdec331dddad62f9fd87bd0abb05
Contents?: true
Size: 1.02 KB
Versions: 209
Compression:
Stored size: 1.02 KB
Contents
import org.scalatest.{Matchers, FlatSpec} class PascalsTriangleTest extends FlatSpec with Matchers { it should "handle 1 row" in { PascalsTriangle.triangle(1) should be (List(List(1))) } it should "handle 2 rows" in { pending PascalsTriangle.triangle(2) should be (List(List(1), List(1, 1))) } it should "handle 3 rows" in { pending PascalsTriangle.triangle(3) should be (List(List(1), List(1, 1), List(1, 2, 1))) } it should "handle 4 rows" in { pending PascalsTriangle.triangle(4) should be (List(List(1), List(1, 1), List(1, 2, 1), List(1, 3, 3, 1))) } it should "handle 5 rows" in { pending PascalsTriangle.triangle(5) should be (List(List(1), List(1, 1), List(1, 2, 1), List(1, 3, 3, 1), List(1, 4, 6, 4, 1))) } it should "handle 20 rows" in { pending PascalsTriangle.triangle(20).takeRight(1).head should be (List(1, 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1)) } }
Version data entries
209 entries across 209 versions & 1 rubygems