Sha256: e7728099a6f37fb88578587b340c736e873e3fa700151d1472e3856e55671c35
Contents?: true
Size: 1.07 KB
Versions: 236
Compression:
Stored size: 1.07 KB
Contents
import org.scalatest.{FunSuite, Matchers} class PythagoreanTripletTest extends FunSuite with Matchers { test("isPythagorean") { PythagoreanTriplet.isPythagorean((3, 4, 5)) should be (true) PythagoreanTriplet.isPythagorean((3, 5, 4)) should be (true) PythagoreanTriplet.isPythagorean((4, 3, 5)) should be (true) PythagoreanTriplet.isPythagorean((4, 5, 3)) should be (true) PythagoreanTriplet.isPythagorean((5, 3, 4)) should be (true) PythagoreanTriplet.isPythagorean((5, 4, 3)) should be (true) PythagoreanTriplet.isPythagorean((3, 3, 3)) should be (false) PythagoreanTriplet.isPythagorean((5, 6, 7)) should be (false) } test("pythagoreanTriplets 1 to 10") { pending PythagoreanTriplet.pythagoreanTriplets(1, 10) should be (Seq((3, 4, 5), (6, 8, 10))) } test("pythagoreanTriplets 11 to 20") { pending PythagoreanTriplet.pythagoreanTriplets(11, 20) should be (Seq((12, 16, 20))) } test("pythagoreanTriplets 56 to 95") { pending PythagoreanTriplet.pythagoreanTriplets(56, 95) should be (Seq((57, 76, 95), (60, 63, 87))) } }
Version data entries
236 entries across 236 versions & 1 rubygems