Sha256: 5798ea577d044a0442214fe4a774bf8058b236e642f63efa74ceacdb6eb0a62f

Contents?: true

Size: 1.51 KB

Versions: 69

Compression:

Stored size: 1.51 KB

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("prime_factors.exs", __DIR__)
end

ExUnit.start()
ExUnit.configure(exclude: :pending, trace: true)

defmodule PrimeFactorsTest do
  use ExUnit.Case

  # @tag :pending
  test "1" do
    assert PrimeFactors.factors_for(1) == []
  end

  @tag :pending
  test "2" do
    assert PrimeFactors.factors_for(2) == [2]
  end

  @tag :pending
  test "3" do
    assert PrimeFactors.factors_for(3) == [3]
  end

  @tag :pending
  test "4" do
    assert PrimeFactors.factors_for(4) == [2, 2]
  end

  @tag :pending
  test "6" do
    assert PrimeFactors.factors_for(6) == [2, 3]
  end

  @tag :pending
  test "8" do
    assert PrimeFactors.factors_for(8) == [2, 2, 2]
  end

  @tag :pending
  test "9" do
    assert PrimeFactors.factors_for(9) == [3, 3]
  end

  @tag :pending
  test "27" do
    assert PrimeFactors.factors_for(27) == [3, 3, 3]
  end

  @tag :pending
  test "625" do
    assert PrimeFactors.factors_for(625) == [5, 5, 5, 5]
  end

  @tag :pending
  test "901255" do
    assert PrimeFactors.factors_for(901_255) == [5, 17, 23, 461]
  end

  @tag :pending
  test "93819012551" do
    assert PrimeFactors.factors_for(93_819_012_551) == [11, 9539, 894_119]
  end

  @tag :pending
  # @tag timeout: 2000
  #
  # The timeout tag above will set the below test to fail unless it completes
  # in under two sconds. Uncomment it if you want to test the efficiency of your
  # solution.
  test "10000000055" do
    assert PrimeFactors.factors_for(10_000_000_055) == [5, 2_000_000_011]
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.179 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.178 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.177 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.176 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.175 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.174 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.173 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.172 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.171 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.170 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.169 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.167 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.166 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.165 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.164 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.163 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.162 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.161 tracks/elixir/exercises/prime-factors/prime_factors_test.exs
trackler-2.2.1.160 tracks/elixir/exercises/prime-factors/prime_factors_test.exs