Sha256: a11302b1133d4d2828fd6a220c782674fa8beb958e590c24ce0228e4cd644af7

Contents?: true

Size: 1.15 KB

Versions: 69

Compression:

Stored size: 1.15 KB

Contents

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

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

defmodule NucleotideCountTest do
  use ExUnit.Case

  # @tag :pending
  test "empty dna string has no adenine" do
    assert NucleotideCount.count('', ?A) == 0
  end

  @tag :pending
  test "repetitive cytosine gets counted" do
    assert NucleotideCount.count('CCCCC', ?C) == 5
  end

  @tag :pending
  test "counts only thymine" do
    assert NucleotideCount.count('GGGGGTAACCCGG', ?T) == 1
  end

  @tag :pending
  test "empty dna string has no nucleotides" do
    expected = %{?A => 0, ?T => 0, ?C => 0, ?G => 0}
    assert NucleotideCount.histogram('') == expected
  end

  @tag :pending
  test "repetitive sequence has only guanine" do
    expected = %{?A => 0, ?T => 0, ?C => 0, ?G => 8}
    assert NucleotideCount.histogram('GGGGGGGG') == expected
  end

  @tag :pending
  test "counts all nucleotides" do
    s = 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC'
    expected = %{?A => 20, ?T => 21, ?C => 12, ?G => 17}
    assert NucleotideCount.histogram(s) == expected
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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