Sha256: 8db91d5ac20b322bbcfaca02ac015597478d1a910ee270c6763cdb22c0b98110

Contents?: true

Size: 1.25 KB

Versions: 33

Compression:

Stored size: 1.25 KB

Contents

import org.scalatest.{FlatSpec, Matchers}

class PrimeFactorsTest extends FlatSpec with Matchers {
  it should "calc empty list" in {
    PrimeFactors.forNumber(1) should be (List())
  }

  it should "calc prime factors of 2" in {
    PrimeFactors.forNumber(2) should be (List(2))
  }

  it should "calc prime factors of 3" in {
    PrimeFactors.forNumber(3) should be (List(3))
  }

  it should "calc prime factors of 4" in {
    PrimeFactors.forNumber(4) should be (List(2, 2))
  }

  it should "calc prime factors of 6" in {
    PrimeFactors.forNumber(6) should be (List(2, 3))
  }

  it should "calc prime factors of 8" in {
    PrimeFactors.forNumber(8) should be (List(2, 2, 2))
  }

  it should "calc prime factors of 9" in {
    PrimeFactors.forNumber(9) should be (List(3, 3))
  }

  it should "calc prime factors of 27" in {
    PrimeFactors.forNumber(27) should be (List(3, 3, 3))
  }

  it should "calc prime factors of 625" in {
    PrimeFactors.forNumber(625) should be (List(5, 5, 5, 5))
  }

  it should "calc prime factors of 901255" in {
    PrimeFactors.forNumber(901255) should be (List(5, 17, 23, 461))
  }

  it should "calc prime factors of 93819012551" in {
    PrimeFactors.forNumber(Long.MaxValue) should be (List(7, 7, 73, 127, 337, 92737, 649657))
  }
}

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
trackler-2.0.3.8 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.7 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.6 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.5 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.4 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.3 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.2 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.1 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.3.0 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.2.0 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.1.2 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.1.1 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.1.0 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.10 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.9 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.8 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.7 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.6 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.5 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala
trackler-2.0.0.4 tracks/scala/exercises/prime-factors/src/test/scala/primefactors_test.scala